From 0c02f133f3daee146b805149e69bba8cee6727b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 15 Oct 2019 14:18:40 +0200 Subject: Plumb application quit through platform plugin If we have a platform plugin we ask the platform to quit, and if not we fall back to the base implementation of QCoreApplication that sends Quit events directly. This allows the platform to involve the rest of the system in the process. The platform will then come back with a spontaneous quit via QWSI::handleApplicationTermination(), which will then send the corresponding Quit even from QGuiApplication like normal. Task-number: QTBUG-45262 Task-number: QTBUG-33235 Task-number: QTBUG-72013 Task-number: QTBUG-59782 Change-Id: I0000aaf7192e4b905933c5da0e53901c6c88f26a Reviewed-by: Lars Knoll --- src/gui/kernel/qguiapplication.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui/kernel/qguiapplication.cpp') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 37e8edb6f7..15955e2287 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -3641,6 +3641,14 @@ bool QGuiApplicationPrivate::shouldQuitInternal(const QWindowList &processedWind return true; } +void QGuiApplicationPrivate::quit() +{ + if (auto *platformIntegration = QGuiApplicationPrivate::platformIntegration()) + platformIntegration->quit(); + else + QCoreApplicationPrivate::quit(); +} + void QGuiApplicationPrivate::processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *windowSystemEvent) { QEvent event(QEvent::Quit); -- cgit v1.2.3