summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-03-21 14:01:18 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-25 14:58:36 +0200
commitd9875f7bff6d52a52a1d0bf4002044a5304cf6bf (patch)
treedef3ade6f466090e7af0d777428dc4de98cf4576 /src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
parentfcf0e67deb25c65648822ed29786948c9ae8e8a6 (diff)
Cocoa: support modal windows
Qt::WindowModal windows and dialogs are shown using [NSApp beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:] as long as they have a valid parent. Otherwise they are behave as application modal. Use the existing modal session support in the QCocoaEventDispatcher (which was inherited from Qt 4) to support Qt::ApplicationModal windows and dialogs. Some changes to this code are needed to ensure proper behavior: 1. Window level modification is now done in QCocoaWindow::recreateWindow() instead of in QCocoaEventDispatcher. 2. Make interrupt() use [NSApp abortModal] to stop a modal session (previously we were freeing memory from under Cocoa's feet, causing tools like valgrind and Instruments.app to complain) 3. Do not remove an item from a list and use a const reference to the removed item immediately after (minor bug fix). Also make sure that QCocoaEventDispatcher cleans up any modal sessions and retained user input events on destruction (otherwise we leave NSApplication in a weird state, which causes some autotest failures). Change-Id: Iaeefa025400f324b5348b8c81a40384ef026efb4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.h')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
index c28cfc5e56..4be30c44ed 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
@@ -177,9 +177,10 @@ public:
void temporarilyStopAllModalSessions();
void beginModalSession(QWindow *widget);
void endModalSession(QWindow *widget);
+ void cleanupModalSessions();
+
void cancelWaitForMoreEvents();
void maybeCancelWaitForMoreEvents();
- void cleanupModalSessions();
void ensureNSAppInitialized();
MacSocketHash macSockets;