From ba60e4bedde9c8ef002289ebe60d25ad95f20707 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 25 Aug 2009 11:24:31 +0200 Subject: 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 --- src/gui/widgets/qmenu_mac.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index d59e1c97f..d9c128357 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 -- cgit v1.2.3