Skip to content

Commit

Permalink
修复:发现Enigma打包后,使用SaveFile标准对话框保存不了文件...改为使用普通输入框保存到同目录下...
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang committed Dec 29, 2019
1 parent 653f0a9 commit aadd7a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CG_Painter/CG_Painter/CG_Painter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QLabel>
#include <QColorDialog>
#include <QFileDialog>
#include <QInputDialog>
#include "ui_CG_Painter.h"
#include "canvas.h"

Expand Down Expand Up @@ -118,11 +118,12 @@ private slots:
refresh_ColorIcon();
}
void action_to_save() {
QString filename = QFileDialog::getSaveFileName(this, u8"保存路径选择", ".", u8"图片 (*.bmp)");
if (!filename.isNull()) {
bool isOK;
QString filename = QInputDialog::getText(NULL, u8"保存当前画布到同目录下", u8"请给当前画布起个名字:", QLineEdit::Normal, "MyCanvas", &isOK);
if (isOK) {
QImage *image = new QImage(geometry().width(), geometry().height(), QImage::Format_RGB888);
myCanvas.getIamge_forSave(image);
(*image).save(filename);
(*image).save(filename + ".bmp");
}
}
void action_to_delete() {
Expand Down

0 comments on commit aadd7a0

Please sign in to comment.