Skip to content

Explicitly call QCoreApplication::exit()

Kai Uwe Broulik requested to merge work/kbroulik/explicitly-exit-qapp into master

In Qt 5, QCoreApplication::quit() was equivalent to calling QCoreApplication::exit(). This just exited the main event loop. In Qt 6, the method will instead try to close all top-level windows by posting a close event. The windows are free to cancel the shutdown process by ignoring the event. Call QCoreApplication::exit() to keep the non-conditional behavior.

Kate already does its own cleanup and close handling when the event loop exits, now leading to double prompts when Qt sends a close event and then Kate tries to close them. Instead, just call exit().

CCBUG: 469690


https://doc.qt.io/qt-6/qtcore-changes-qt6.html#other-classes

Ran Kate, typed something, Ctrl+Q, got only a single “Save?” prompt on Qt 6.

(I have no idea what this KateWaiter does but I ported it, too)

Edited by Kai Uwe Broulik

Merge request reports

Loading