diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-01-17 14:46:40 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-02-21 18:43:16 +0000 |
commit | 4cbc7f798017d76e018dc3f04968703624b6a6cf (patch) | |
tree | ae62974a44e7a023c91e517abf865caffb499dfe /src | |
parent | 2f9bdeba17ac1e980c0b9702c4f346c242da6ef1 (diff) |
Support synchronous handleCloseEvent()
Use QT_DEFINE_QPA_EVENT_HANDLER to define
QWindowSystemInterface::handleCloseEvent().
Change-Id: I4f1105f7aa78bdebddfe9062b388eb616e325e31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 318a280a40..e5cd0be519 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -335,12 +335,12 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleExposeEvent, QWindow *window, const QReg QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e); } -void QWindowSystemInterface::handleCloseEvent(QWindow *window, bool *accepted) +QT_DEFINE_QPA_EVENT_HANDLER(void, handleCloseEvent, QWindow *window, bool *accepted) { if (window) { QWindowSystemInterfacePrivate::CloseEvent *e = new QWindowSystemInterfacePrivate::CloseEvent(window, accepted); - QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); + QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e); } } diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index b22495f9d0..d584374fca 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -193,6 +193,7 @@ public: template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleExposeEvent(QWindow *window, const QRegion ®ion); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleCloseEvent(QWindow *window, bool *accepted = nullptr); template<typename Delivery = QWindowSystemInterface::DefaultDelivery> |