qt5base-lts/examples
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
..
aggregate
corelib Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
dbus CMake: Workaround building DBus 'car' example with qmake 2020-08-23 11:04:04 +02:00
embedded Port the QXmlStream API from QStringRef to QStringView 2020-08-19 19:48:03 +02:00
gui CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
network QAbstractSocket: Resolve remaining Qt6 TODOs 2020-08-24 17:43:56 +02:00
opengl CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
qmake Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
qpa CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
qtconcurrent CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
qtestlib Don't depend on tools for the qtestlib examples 2020-08-12 19:37:15 +02:00
sql Deprecate the static int based API in QMetaType 2020-08-24 00:19:05 +02:00
vulkan Fix compiler warning about qsizetype/int mismatch 2020-08-04 13:28:33 +02:00
widgets Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
xml Port the QXmlStream API from QStringRef to QStringView 2020-08-19 19:48:03 +02:00
CMakeLists.txt CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
examples.pro Doc: Move touch examples around so they get included in docs 2018-09-14 03:56:22 +00:00
README

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.