qt5base-lts/examples/widgets/mainwindows
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
..
application Remove "fallback session management" 2020-09-01 10:16:15 +02:00
dockwidgets High-DPI: Remove usage of Qt::AA_EnableHighDpiScaling 2020-08-28 20:08:43 +02:00
mainwindow High-DPI: Remove usage of Qt::AA_EnableHighDpiScaling 2020-08-28 20:08:43 +02:00
mdi Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
menus CMake: Regenerate examples 2020-07-09 09:38:28 +02:00
sdi Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
CMakeLists.txt CMake: Add widgets examples 2019-03-26 15:25:39 +00:00
mainwindows.pro Add recent file handling to SDI/MDI and remove the recentfiles example. 2015-07-31 04:30:35 +00:00
README Moving .qdoc files under examples/widgets/doc 2012-08-20 12:20:55 +02:00

All the standard features of application main windows are provided by Qt.

Main windows can have pull down menus, tool bars, and dock windows. These
separate forms of user input are unified in an integrated action system that
also supports keyboard shortcuts and accelerator keys in menu items.


Documentation for these examples can be found via the Examples
link in the main Qt documentation.