Fix native file dialogs from widgets QFileDialog

Review Request #123335 - Created April 11, 2015 and submitted

Information
David Rosca
frameworkintegration
master
Reviewers
kdeframeworks
dfaure, lukas

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().

QML dialogs:
example from bug 334963 works fine
file dialog from plasma desktop settings -> wallpapers works fine

QtWidgets dialogs:
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)?

Issues

  • 1
  • 0
  • 0
  • 1
Description From Last Updated
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 Hrvoje Senjan
Lukáš Tinkl
Aleix Pol Gonzalez
David Rosca
Jeremy Whiting
Jeremy Whiting
David Rosca
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 26406a9aa01d6f4f01a3f084b51451de8385c8fc by David Rosca to branch master.
Hrvoje Senjan

   

This somehow breaks dialogs from QFileDialog. e.g. standarddialogs' QFileDialog::getOpenFileName() from Qt examples, smplayer, vlc dialogs are all broken (they don't show). Strangely, removing this line fixes the problem here

  1. Hmm, i don't think that's really possible.
    Can you please show an example QFileDialog invocation that triggers this bug?

  2. i can't even run qfiledialogtest from tests dir:

    #1  0x00007fb235226e54 in  () at /usr/lib64/libglib-2.0.so.0
    #2  0x00007fb235226f6c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
    #3  0x00007fb2366ee7fc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x189e540, flags=...)
        at kernel/qeventdispatcher_glib.cpp:418
    #4  0x00007fb23669540b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7ffdd2b01410, flags=...)
        at kernel/qeventloop.cpp:204
    #5  0x00007fb236e2461d in QDialog::exec() () at /usr/lib64/libQt5Widgets.so.5
    #6  0x00007fb22ad03dfe in KDEPlatformFileDialogHelper::exec() (this=0x18d5db0) at ../src/platformtheme/kdeplatformfiledialoghelper.cpp:282
    #7  0x00007fb236e244ca in QDialog::exec() () at /usr/lib64/libQt5Widgets.so.5
    #8  0x0000000000402990 in main(int, char**) (argc=1, argv=<optimized out>) at ../tests/qfiledialogtest.cpp:94
    
Loading...