!16 修复-截图保存时,会先跳转到最近保存的路径,然后又跳回图片路径

Merge pull request !16 from Ginhou/fix-savedialog-path
This commit is contained in:
泮进瑞 2024-08-27 06:27:14 +00:00 committed by Gitee
commit f955dabdfc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 2 deletions

View File

@ -24,11 +24,10 @@
#include "src/utils/filenamehandler.h"
MySaveDialog::MySaveDialog(QWidget *parent) :
QFileDialog(parent)
QFileDialog(parent, QString(), QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0))
{
// setWindowIcon(QIcon::fromTheme("kylin-screenshot"));
setNameFilter(QLatin1String(" PNG(*.png);;BMP(*.bmp);;JPEG(*.jpg)"));
setDirectory(QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0));
setAcceptMode(QFileDialog::AcceptSave);
setDefaultSuffix("png");
setLabelText(QFileDialog::Reject, tr("Cancel"));