I'm using plain Qt5 applications and since I'm running Plasma, KDE dialogs automatically replace Qt's built-in dialogs. The problem is with the Save dialog (QFileDialog::getSaveFileName()). If the "filter" parameter contains 2 filters with the same extensions, the "selectedFilter" parameter is always set to the first one, no matter which one the user selected. Example code: -------------------------- QString selectedFilter; QString fileName = QFileDialog::getSaveFileName(this, "QFileDialog::getSaveFileName()", "hello.txt", "All Files (*);;UTF-16 Files (*.txt);;UTF-8 Files (*.txt)", &selectedFilter); qWarning() << "selectedFilter: " << selectedFilter; -------------------------- If the user selects "UTF-8 Files (*.txt)", "UTF-16 Files (*.txt)" is printed instead. Qt's built-in dialog don't have this problem. Thanks
I have a similar problem. The KDE file dialog always choose the first extension filter, but apparently also when the extensions are different. When you save a webpage in Firefox, you can choose to save it as "webpage complete" or "webpage html only", and it always choose the first entry in the list "webpage complete". Firefox had an option to use their own xul dialog rather than the kde dialog, but it seems they have removed that option. Then in TeXstudio you can save a file as .tex file or with another file extension (e.g. plaintext (*.txt) or all files (*)), but the QFileDialog always switches back to .tex files when saving another file. Only the QFileDialog::DontUseNativeDialog fixes this.