Am 04.03.2017 um 20:59 schrieb David Faure:
On samedi 4 mars 2017 12:03:08 CET Frank Schäfer wrote:
Hi,
I'm trying to track down a bug which occurs when using
QFileDialog::getSaveFileName in a Qt5-application.
With option QFileDialog::DontUseNativeDialog a different dialog
displayed, so a native file dialog seems to be used.
I've checked the source code of QFileDialog::getSaveFileName and it
calls the file dialog which is hooked into
_qt_filedialog_save_filename_hook.
For KDE4, this seems to be KDialog::getSaveFileName(), but I wasn't able
to find out if and where this hook is used in KDE5.
The hook is gone in Qt5 (or at least unused).
Urgh, I was looking at the wrong Qt version. :/
Does KDE5 provide a native file dialog at all ?
Yes.
If yes, can anybody point me to the right direction ?
plasma-integration.git provides a "platform theme" plugin which brings in the
KDE file dialog, cf src/platformtheme/kdeplatformfiledialoghelper.cpp
Thanks, that helps a lot !
Which dialog is used if KDE4 and KDE5 libraries are installed ?
There is no KDE5 ;)
I know. ;)
If you have KF5 and plasma-integration installed, then you'll get the Qt5/KF5
based file dialog.
Otherwise you'll get the builtin Qt dialog.
No way will you ever get a kdelibs4/qt4-based dialog in a Qt5 application,
that would require loading both versions of Qt at the same time, which is
impossible ;)
Ok, I'm glad to hear that.
Cheers,
Frank