qt6-bb10/examples/widgets
Tor Arne Vestbø 89f7a2759c Deliver Quit event when calling QCoreApplication::quit()
Instead of QCoreApplication::quit() directly calling exit(0), which would
leave QGuiApplication and client code out of the loop, we now send the
Quit event, and let it pass through event delivery, before finally ending
up in QCoreApplication::event(), where we call exit(0).

This has the advantage that QGuiApplication can ensure all windows are
closed before quitting, and if any of those windows ignore the close
event the quit will be aborted. This aligns the behavior of synthetic
quits via QCoreApplication::quit() with spontaneous quits from the
platform via QGuiApplicationPrivate::processApplicationTermination.

Clients who wish to exit the application without any event delivery or
potential user interaction can call the lower level exit() function
directly.

[ChangeLog][QtGui] Application termination via qApp->quit() will now
deliver Quit events to the application, which in turn will result in
application windows being closed as part of the application quit,
with an option to cancel the application quit by ignoring the close
event. Clients who explicitly want to exit the application without
any user interaction should call QCoreApplication::exit() explicitly.

Task-number: QTBUG-45262
Task-number: QTBUG-33235
Task-number: QTBUG-72013
Task-number: QTBUG-59782
Change-Id: Id4b3907e329b9ecfd936fe9a5f8a70cb66b76bb7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-07 14:41:16 +02:00
..
animation Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
desktop Long live QKeyCombination! 2020-09-03 07:00:31 +02:00
dialogs CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
doc macOS: rename 'macintosh' style to 'macos' 2020-08-26 16:37:43 +02:00
draganddrop CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
effects CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
gallery Deprecate and remove uses of AA_DisableHighDpiScaling 2020-08-31 19:14:55 +02:00
gestures CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
graphicsview High-DPI: Remove usage of Qt::AA_EnableHighDpiScaling 2020-08-28 20:08:43 +02:00
itemviews Remove deprecated QPrinter and QPagedPaintDevice APIs 2020-09-04 08:37:59 +02:00
layouts CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
mainwindows Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
painting Remove deprecated QPrinter and QPagedPaintDevice APIs 2020-09-04 08:37:59 +02:00
qnx/foreignwindows Use QList instead of QVector in statemachine 2020-07-06 14:06:13 +02:00
richtext Long live QKeyCombination! 2020-09-03 07:00:31 +02:00
scroller CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
tools High-DPI: Remove usage of Qt::AA_EnableHighDpiScaling 2020-08-28 20:08:43 +02:00
touch CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
tutorials CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
widgets High-DPI: Remove usage of Qt::AA_EnableHighDpiScaling 2020-08-28 20:08:43 +02:00
windowcontainer CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
.prev_CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
widgets.pro Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00