Bug 484217 - KDE native program continues to run although setQuitOnLastWindowClosed is true
Summary: KDE native program continues to run although setQuitOnLastWindowClosed is true
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-22 07:38 UTC by wolf.seifert
Modified: 2024-05-04 06:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
qfiledialog.cpp + CMakeLists.txt (754 bytes, application/zip)
2024-03-22 07:38 UTC, wolf.seifert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wolf.seifert 2024-03-22 07:38:35 UTC
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
Comment 1 wolf.seifert 2024-03-24 04:46:00 UTC
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
Comment 2 wolf.seifert 2024-05-04 06:46:03 UTC
It was fixed as a side-effect of fixing https://bugreports.qt.io/browse/QTBUG-124386.