path: root/src/gui/kernel/qwindowsysteminterface.h
diff options
authorJosh Faust <>2013-03-14 15:13:34 -0700
committerThe Qt Project <>2013-04-26 14:18:16 +0200
commitc90d9b697f6ef549d33047332a9c44b40ded63f5 (patch)
treeef7c7686cfbc86ba6055831a14088b3531cd3026 /src/gui/kernel/qwindowsysteminterface.h
parente12d384d7b898f949bc5ad27a473eee2ec92a711 (diff)
Fix ignoring close events on OSX
QNSWindowDelegate was not handling windowShouldClose, which is how you can tell Cocoa that your window should not close if the close button is pressed. This change moves the close handling from windowWillClose to windowShouldClose, and adds an optional "accepted" pointer to QWindowSystemInterface::handleCloseEvent so that QNSWindowDelegate can return a true/false value for whether the window should actually close Task-number: QTBUG-28965 Change-Id: I67c6296ad42cbeeb71413e05411467d4e558adb4 Reviewed-by: Morten Johan Sørvig <>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index 212259c113..521c2a4941 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -131,7 +131,7 @@ public:
static void handleTouchCancelEvent(QWindow *w, ulong timestamp, QTouchDevice *device, Qt::KeyboardModifiers mods = Qt::NoModifier);
static void handleGeometryChange(QWindow *w, const QRect &newRect);
- static void handleCloseEvent(QWindow *w);
+ static void handleCloseEvent(QWindow *w, bool *accepted = 0);
static void handleEnterEvent(QWindow *w, const QPointF &local = QPointF(), const QPointF& global = QPointF());
static void handleLeaveEvent(QWindow *w);
static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local = QPointF(), const QPointF& global = QPointF());