summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-08-25 11:24:31 +0200
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-08-25 11:50:43 +0200
commitba60e4bedde9c8ef002289ebe60d25ad95f20707 (patch)
tree51d7ac62fcba5a64c0ccd3a6e765b392ba8d2e91
parentf29e1bc7b7a593ef65defa3543b0feea455c7cdb (diff)
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
-rw-r--r--src/gui/widgets/qmenu_mac.mm6
1 files changed, 6 insertions, 0 deletions
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