Add QFileDialog::DontUseNativeDialog

This commit is contained in:
2022-11-22 11:04:04 +01:00
parent af5aed7ef8
commit f8f9ee08b3
+17 -4
View File
@@ -293,7 +293,10 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::copyOrMove(bool copy) void MainWindow::copyOrMove(bool copy)
{ {
QString dest = QFileDialog::getExistingDirectory(this, tr("Select destination"), _lastDir); QString dest = QFileDialog::getExistingDirectory(this,
tr("Select destination"),
_lastDir,
QFileDialog::ShowDirsOnly | QFileDialog::DontUseNativeDialog);
copyOrMove(copy, dest); copyOrMove(copy, dest);
} }
@@ -366,7 +369,12 @@ void MainWindow::pixmapLoaded(Image *image)
void MainWindow::loadFile() void MainWindow::loadFile()
{ {
QString file = QFileDialog::getOpenFileName(this, tr("Open file"), _lastDir, tr("Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)")); QString file = QFileDialog::getOpenFileName(this,
tr("Open file"),
_lastDir,
tr("Images (*.jpg *.jpeg *.png *.cr2 *.nef *.dng *.fit *.fits *.xisf *.JPG *.JPEG *.PNG *.CR2 *.NEF *.DNG *.FIT *.FITS *.XISF)"),
nullptr,
QFileDialog::DontUseNativeDialog);
loadFile(file); loadFile(file);
} }
@@ -393,7 +401,7 @@ void MainWindow::loadFile(int row)
void MainWindow::indexDir() void MainWindow::indexDir()
{ {
QString dir = QFileDialog::getExistingDirectory(this, tr("Index directory"), _lastDir); QString dir = QFileDialog::getExistingDirectory(this, tr("Index directory"), _lastDir, QFileDialog::ShowDirsOnly | QFileDialog::DontUseNativeDialog);
indexDir(dir); indexDir(dir);
} }
@@ -417,7 +425,12 @@ void MainWindow::reindex()
void MainWindow::saveAs() void MainWindow::saveAs()
{ {
QString selectedFilter; QString selectedFilter;
QString file = QFileDialog::getSaveFileName(this, tr("Save as"), _lastDir, tr("JPEG (*.jpg *.JPG);; PNG (*.png *.PNG);;FITS (*.fits *.FITS);;XISF (*.xisf *.XISF)"), &selectedFilter); QString file = QFileDialog::getSaveFileName(this,
tr("Save as"),
_lastDir,
tr("JPEG (*.jpg *.JPG);; PNG (*.png *.PNG);;FITS (*.fits *.FITS);;XISF (*.xisf *.XISF)"),
&selectedFilter,
QFileDialog::DontUseNativeDialog);
if(!file.isEmpty()) if(!file.isEmpty())
{ {
QFileInfo info(file); QFileInfo info(file);