diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-25 09:24:31 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-25 09:50:43 (GMT) |
commit | ba60e4bedde9c8ef002289ebe60d25ad95f20707 (patch) | |
tree | 51d7ac62fcba5a64c0ccd3a6e765b392ba8d2e91 /src/gui/widgets/qmenu_mac.mm | |
parent | f29e1bc7b7a593ef65defa3543b0feea455c7cdb (diff) | |
download | Qt-ba60e4bedde9c8ef002289ebe60d25ad95f20707.zip Qt-ba60e4bedde9c8ef002289ebe60d25ad95f20707.tar.gz Qt-ba60e4bedde9c8ef002289ebe60d25ad95f20707.tar.bz2 |
Mac: When using Qt as a plugin app, menubars does not work
It seems like we don't respect the Qt::AA_MacPluginApplication
attribute. Setting this attribute means that the native application
should control the menu bar. This patch does a check for this, and
leaves the menubar alone if its set.
We could consider allowing menubars if the Qt::AA_DontUseNativeMenuBar
is set (those should placed inside the window)
Reviewed-by: msorvig
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index d59e1c9..d9c1283 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -728,6 +728,9 @@ bool qt_mac_menubar_is_open() void qt_mac_clear_menubar() { + if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) + return; + #ifndef QT_MAC_USE_COCOA MenuRef clear_menu = 0; if (CreateNewMenu(0, 0, &clear_menu) == noErr) { @@ -1918,6 +1921,9 @@ static void cancelAllMenuTracking() */ bool QMenuBar::macUpdateMenuBar() { + if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) + return false; + cancelAllMenuTracking(); QMenuBar *mb = 0; //find a menu bar |