Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.2
-
None
Description
The Qt API docs for [QFileDialog| https://doc.qt.io/qt-5/qfiledialog.html tell for the signal QFileDialog::urlsSelected(const QList<QUrl> &urls):
"When the selection changes and the dialog is accepted, this signal is emitted with the (possibly empty) list of selected urls."
So one would assume this signal and its fellow urlSelected(QUrl) are emitted without any platform specific conditions.
Yet when QFileDialog does not get a QPlatformFileDialogHelper instance from any QPlatformTheme for QPlatformTheme::FileDialog, it will use its native implementation, which seems to not care for emitting the signals urlsSelected+urlSelected.
Can be tested with attached sample program. I found no documented way to force the platformtheme to something using only Qt native code, best bet for me (in Plasma/Linux env) was forcing platform xcb and some dummy value for XDG_CURRENT_DESKTOP. Might need another way for you, if there is no official way.
It shows how selecting a file and accepting the dialig does not trigger the signals with native QFileDialog implementation:
> qmake > make > QT_QPA_PLATFORM=XCB XDG_CURRENT_DESKTOP=UNKNOWN ./src # no ouput > QT_QPA_PLATFORM=XCB XDG_CURRENT_DESKTOP=KDE ./src # expected output QFileDialog::urlsSelected emitted (QUrl("file:///home/user/some/file.txt")) QFileDialog::urlSelected emitted QUrl("file:///home/user/some/file.txt")