Created attachment 167589 [details] qfiledialog.cpp + CMakeLists.txt SUMMARY *** After closing the QFileDialog the program should terminate because QGuiApplication::setQuitOnLastWindowClosed(true) by default. But the program continues to run. When using QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs) (i.e. qt dialogs) the program behaves as expected: it quits if setQuitOnLastWindowClosed(true), it continues if setQuitOnLastWindowClosed(false). *** STEPS TO REPRODUCE 1. Unzip the attached qfiledialog.zip 2. Build with cmake 3. Run the program OBSERVED RESULT After closing the dialog the program continues to run. EXPECTED RESULT After closing the dialog the program should terminate. Native and non-native dialogs should behave consistent. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux KDE Plasma Version: 6.0.2 KDE Frameworks Version: 6.0.0 Qt Version: 6.0.0 Graphic Platform: Wayland
Deleting these lines // eventLoopLocker prevents QCoreApplication from exiting when the last // window is closed until the job has finished running QEventLoopLocker eventLoopLocker; from kjob_p.h resolved this issue. See also https://bugs.kde.org/show_bug.cgi?id=483439#c16
It was fixed as a side-effect of fixing https://bugreports.qt.io/browse/QTBUG-124386.