diff --git a/src/app/valentina/dialogs/configpages/preferencespathpage.cpp b/src/app/valentina/dialogs/configpages/preferencespathpage.cpp index 6ed3a803b..a2bcbd790 100644 --- a/src/app/valentina/dialogs/configpages/preferencespathpage.cpp +++ b/src/app/valentina/dialogs/configpages/preferencespathpage.cpp @@ -137,7 +137,9 @@ void PreferencesPathPage::EditPath() } const QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), path, - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + QFileDialog::ShowDirsOnly + | QFileDialog::DontResolveSymlinks + | QFileDialog::DontUseNativeDialog); if (dir.isEmpty()) { if (usedNotExistedDir) diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index 40314e6da..f88206d3c 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -787,7 +787,8 @@ void DialogPatternProperties::InitImage() void DialogPatternProperties::ChangeImage() { const QString filter = tr("Images") + QLatin1String(" (*.png *.jpg *.jpeg *.bmp)"); - const QString fileName = QFileDialog::getOpenFileName(this, tr("Image for pattern"), QString(), filter); + const QString fileName = QFileDialog::getOpenFileName(this, tr("Image for pattern"), QString(), filter, nullptr, + QFileDialog::DontUseNativeDialog); QImage image; if (fileName.isEmpty()) { @@ -832,7 +833,8 @@ void DialogPatternProperties::SaveImage() QByteArray ba = QByteArray::fromBase64(byteArray); const QString extension = QLatin1String(".") + doc->GetImageExtension(); QString filter = tr("Images") + QLatin1String(" (*") + extension + QLatin1String(")"); - QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), tr("untitled"), filter, &filter); + QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), tr("untitled"), filter, &filter, + QFileDialog::DontUseNativeDialog); if (not filename.isEmpty()) { if (not filename.endsWith(extension.toUpper())) diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index f4863c85d..e5aa81532 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -105,7 +105,9 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget * } const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"), dirPath, - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + QFileDialog::ShowDirsOnly + | QFileDialog::DontResolveSymlinks + | QFileDialog::DontUseNativeDialog); if (not dir.isEmpty()) {// If paths equal the signal will not be called, we will do this manually dir == ui->lineEditPath->text() ? PathChanged(dir) : ui->lineEditPath->setText(dir); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index ec0562d02..05994ad4b 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1507,7 +1507,8 @@ void MainWindow::LoadIndividual() usedNotExistedDir = directory.mkpath("."); } - const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); + const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr, + QFileDialog::DontUseNativeDialog); if (not mPath.isEmpty()) { @@ -1544,7 +1545,8 @@ void MainWindow::LoadStandard() //Use standard path to standard measurements QString path = qApp->ValentinaSettings()->GetPathStandardMeasurements(); path = VCommonSettings::PrepareStandardTables(path); - const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); + const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr, + QFileDialog::DontUseNativeDialog); if (not mPath.isEmpty()) { @@ -2536,7 +2538,7 @@ bool MainWindow::SaveAs() QString fileName = QFileDialog::getSaveFileName(this, tr("Save as"), dir + QLatin1String("/") + tr("pattern") + QLatin1String(".val"), - filters); + filters, nullptr, QFileDialog::DontUseNativeDialog); auto RemoveTempDir = [usedNotExistedDir, dir]() { @@ -2727,7 +2729,8 @@ void MainWindow::Open() dir = QFileInfo(files.first()).absolutePath(); } qCDebug(vMainWindow, "Run QFileDialog::getOpenFileName: dir = %s.", qUtf8Printable(dir)); - const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter); + const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter, nullptr, + QFileDialog::DontUseNativeDialog); if (filePath.isEmpty()) { return; @@ -4503,7 +4506,8 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS //Use standard path to standard measurements QString path = qApp->ValentinaSettings()->GetPathStandardMeasurements(); path = VCommonSettings::PrepareStandardTables(path); - mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr, + QFileDialog::DontUseNativeDialog); } else if (patternType == MeasurementsType::Individual) { @@ -4518,7 +4522,8 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS usedNotExistedDir = directory.mkpath("."); } - mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr, + QFileDialog::DontUseNativeDialog); if (usedNotExistedDir) { @@ -4541,7 +4546,8 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS usedNotExistedDir = directory.mkpath("."); } - mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter); + mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr, + QFileDialog::DontUseNativeDialog); if (usedNotExistedDir) { diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 76a521000..9674b9c56 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -859,7 +859,7 @@ void MainWindowsNoGUI::SaveLayoutAs() QString fileName = QFileDialog::getSaveFileName(this, tr("Print to pdf"), dir + QLatin1String("/") + FileName() + QLatin1String(".pdf"), - tr("PDF file (*.pdf)")); + tr("PDF file (*.pdf)"), nullptr, QFileDialog::DontUseNativeDialog); if (not fileName.isEmpty()) { QFileInfo f( fileName ); diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp index 5f77a4749..c89c171fc 100644 --- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp @@ -111,9 +111,12 @@ QString VPE::VFileEditWidget::getFile() const void VPE::VFileEditWidget::onToolButtonClicked() { - QString filepath = (Directory ? QFileDialog::getExistingDirectory(0, tr("Directory"), CurrentFilePath) + QString filepath = (Directory ? QFileDialog::getExistingDirectory(0, tr("Directory"), CurrentFilePath, + QFileDialog::ShowDirsOnly + | QFileDialog::DontUseNativeDialog) : QFileDialog::getOpenFileName(0, tr("Open File"), CurrentFilePath, - FileDialogFilter)); + FileDialogFilter, nullptr, + QFileDialog::DontUseNativeDialog)); if (filepath.isNull() == false) { setFile(filepath, true); diff --git a/src/libs/vwidgets/vabstractmainwindow.cpp b/src/libs/vwidgets/vabstractmainwindow.cpp index 7c74d51a6..6454ae80a 100644 --- a/src/libs/vwidgets/vabstractmainwindow.cpp +++ b/src/libs/vwidgets/vabstractmainwindow.cpp @@ -99,7 +99,8 @@ void VAbstractMainWindow::ExportToCSV() const QString suffix("csv"); const QString path = QDir::homePath() + QLatin1String("/") + tr("values") + QLatin1String(".") + suffix; - QString fileName = QFileDialog::getSaveFileName(this, tr("Export to CSV"), path, filters); + QString fileName = QFileDialog::getSaveFileName(this, tr("Export to CSV"), path, filters, nullptr, + QFileDialog::DontUseNativeDialog); if (fileName.isEmpty()) {