Fix native file dialogs from widgets QFileDialog
Review Request #123335 - Created April 11, 2015 and submitted
9814e4b773b2b34afafa0c5d242594bbb4f9a6ae fixed QML file dialogs but broke QtWidgets dialogs.
QFileDialog static functions - dialog would open, but any user interaction is blocked (cannot select files or click on anything).
QFileDialog *d = new QFileDialog(parent); d->open(); - dialog would not open at all
The first issue occurs because exec() is called on already shown dialog. This is fixed by explicit hide() before calling exec() - kind of hacky :/
The second issue is fixed by always calling show().
example from bug 334963 works fine
file dialog from plasma desktop settings -> wallpapers works fine
static dialogs from qtbase/examples/widgets/dialogs/standarddialogs works fine
QFileDialog *d = new QFileDialog(parent); d->open(); works fine
test app: https://paste.kde.org/psddcng5n
I'm running Qt 5.4.1.
Are there any other types of dialogs that I forgot (and possibly broke)?
|This somehow breaks dialogs from QFileDialog. e.g. standarddialogs' QFileDialog::getOpenFileName() from Qt examples, smplayer, vlc dialogs are all broken (they don't ...||Hrvoje Senjan|
Add unittests for show(), open() and QML dialogs, each with and without parent.
I am not sure how to test non-interactive bug with exec() though
Revision 2 (+182 -2)
Looks good to me. The explanation makes sense also. I did see most dialogs working after Lukas' fix, but the one launched from chromium via kdialog still hung after that. This should fix that (I'll test it later today)
Status: Closed (submitted)
Submitted with commit 26406a9aa01d6f4f01a3f084b51451de8385c8fc by David Rosca to branch master.