summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-22 10:01:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-22 10:01:00 (GMT)
commit0d446ec758aacd131f2da0fa67a081fd93cff898 (patch)
treeccce31575104d29df35a781efc8e7ccf3f547637 /src
parenta560dca4541ff5839ba0588ce27e093caeb4780b (diff)
parentc3ad479d449375ca4b600d62e4c72b34a36736d7 (diff)
downloadQt-0d446ec758aacd131f2da0fa67a081fd93cff898.zip
Qt-0d446ec758aacd131f2da0fa67a081fd93cff898.tar.gz
Qt-0d446ec758aacd131f2da0fa67a081fd93cff898.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QTBUG-13301: The menubar does now work when no window is showing
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qcocoaapplication_mac.mm11
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h10
2 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/kernel/qcocoaapplication_mac.mm b/src/gui/kernel/qcocoaapplication_mac.mm
index 9270213..1b30efd 100644
--- a/src/gui/kernel/qcocoaapplication_mac.mm
+++ b/src/gui/kernel/qcocoaapplication_mac.mm
@@ -183,6 +183,17 @@ QT_USE_NAMESPACE
[super sendEvent:event];
}
+- (void)qtDispatcherToQAction:(id)sender
+{
+ // Forward actions sendt from the menu bar (e.g. quit) to the menu loader.
+ // Having this method here means that we are the last stop in the responder
+ // chain, and that we are able to handle menu actions even when no window is
+ // visible on screen. Note: If Qt is used as a plugin, Qt will not use a
+ // native menu bar. Hence, we will also not need to do any redirection etc. as
+ // we do with sendEvent.
+ [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender];
+}
+
@end
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 970bc0a..efe045c 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -136,16 +136,6 @@ QT_END_NAMESPACE
qt_dispatchTabletProximityEvent(tabletEvent);
}
-- (void)qtDispatcherToQAction:(id)sender
-{
- // If this window is modal, the menu bar will be modally shaddowed.
- // In that case, since the window will be in the first responder chain,
- // we can still catch the trigger here and forward it to the menu bar.
- // This is needed as a single modal dialog on Qt should be able to access
- // the application menu (e.g. quit).
- [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender];
-}
-
- (void)terminate:(id)sender
{
// This function is called from the quit item in the menubar when this window