Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.11.3
-
None
-
Debian testing with KDE Plasma 5 and Qt installed from Debian repository (Plasma integration with native file pickers doesn't work out-of the box with custom-built qt from dev branch)
Description
'QFileDialog::selectFile()' does not pre-fill the given file name in the native file dialog if the dialog has previously been a non-native one, e.g. for this simplified example:
#include <QApplication> #include <QFileDialog> int main(int argc, char *argv[]) { QApplication a(argc, argv); QFileDialog fileDialog; fileDialog.setOption(QFileDialog::DontUseNativeDialog); fileDialog.setOption(QFileDialog::DontUseNativeDialog, false); fileDialog.selectFile("test.txt"); fileDialog.exec(); return a.exec(); }
When executing this example on KDE Plasma 5, no text is pre-filled in the "Name" textbox.
Expected result: The text "test.txt" should be pre-selected for the file name. It does work as expected when leaving out the 'fileDialog.setOption()' calls.
As far as I can see, the problem is that the call to 'd->usingWidgets()' inside 'QFileDialog::selectFile' (s. [1]) returns true because 'qFileDialogUi' has previously been initialized in the call to 'QFileDialog::setOption(QFileDialog::DontUseNativeDialog)'.