diff --git a/ui/ImportDialog.cpp b/ui/ImportDialog.cpp index e1bfb97e..1716fffc 100644 --- a/ui/ImportDialog.cpp +++ b/ui/ImportDialog.cpp @@ -61,7 +61,20 @@ void ImportDialog::browse() QString filename = QFileDialog::getOpenFileName(this, tr("Select File"), lastPath, - ui->typeSelect->currentText().toUpper() + "(*." + ui->typeSelect->currentText().toLower() + ")"); + ui->typeSelect->currentText().toUpper() + "(*." + ui->typeSelect->currentText().toLower() + ")", + nullptr, +#if defined(Q_OS_LINUX) + // Do not use the Native Dialog under Linux because the dialog is case-sensitive. + // QT variant looks different but it is case-insensitive. + // More information: + // https://stackoverflow.com/questions/34858220/qt-how-to-set-a-case-insensitive-filter-on-qfiledialog + // https://bugreports.qt.io/browse/QTBUG-51712 + QFileDialog::DontUseNativeDialog +#else + QFileDialog::Options() +#endif + + ); if ( !filename.isEmpty() ) { settings.setValue("import/last_path", QFileInfo(filename).path()); diff --git a/ui/PaperQSLDialog.cpp b/ui/PaperQSLDialog.cpp index 2d226032..3c52c970 100644 --- a/ui/PaperQSLDialog.cpp +++ b/ui/PaperQSLDialog.cpp @@ -48,11 +48,22 @@ void PaperQSLDialog::addFileClick() tr("Add File"), lastPath, #if defined(Q_OS_WIN) - "" + "", #elif defined(Q_OS_MACOS) - "" + "", #else - "" + "", +#endif + nullptr, +#if defined(Q_OS_LINUX) + // Do not use the Native Dialog under Linux because the dialog is case-sensitive. + // QT variant looks different but it is case-insensitive. + // More information: + // https://stackoverflow.com/questions/34858220/qt-how-to-set-a-case-insensitive-filter-on-qfiledialog + // https://bugreports.qt.io/browse/QTBUG-51712 + QFileDialog::DontUseNativeDialog +#else + QFileDialog::Options() #endif ); if ( !filename.isEmpty() ) diff --git a/ui/SettingsDialog.cpp b/ui/SettingsDialog.cpp index 21cc84c9..81001920 100644 --- a/ui/SettingsDialog.cpp +++ b/ui/SettingsDialog.cpp @@ -1820,11 +1820,22 @@ void SettingsDialog::tqslPathBrowse() tr("Select File"), lastPath, #if defined(Q_OS_WIN) - "TQSL (*.exe)" + "TQSL (*.exe)", #elif defined(Q_OS_MACOS) - "TQSL (*.app)" + "TQSL (*.app)", #else - "TQSL (tqsl)" + "TQSL (tqsl)", +#endif + nullptr, +#if defined(Q_OS_LINUX) + // Do not use the Native Dialog under Linux because the dialog is case-sensitive. + // QT variant looks different but it is case-insensitive. + // More information: + // https://stackoverflow.com/questions/34858220/qt-how-to-set-a-case-insensitive-filter-on-qfiledialog + // https://bugreports.qt.io/browse/QTBUG-51712 + QFileDialog::DontUseNativeDialog +#else + QFileDialog::Options() #endif ); if ( !filename.isEmpty() )