summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ulattil@nokia.com>2009-10-15 12:47:35 (GMT)
committerPrasanth Ullattil <prasanth.ulattil@nokia.com>2009-10-15 12:47:35 (GMT)
commit2eb373a68367a6511e12d60034e920345431bcc8 (patch)
treeed525e4fefd6d5a7377f945ab6b10b2eef697306 /src/gui/widgets
parent4f2fecbdb852028bd191fa63aa66527107672dc7 (diff)
downloadQt-2eb373a68367a6511e12d60034e920345431bcc8.zip
Qt-2eb373a68367a6511e12d60034e920345431bcc8.tar.gz
Qt-2eb373a68367a6511e12d60034e920345431bcc8.tar.bz2
Some sub menus are disabled in Cocoa
The commit faec535829a0e454a6784b0c5c37cb63e7da8f73 introduced this bug. Since we can add a submenu to the same supermenu, we should consider it before disabling the submenu who already have a supermenu. Reviewed-by: MortenS
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qmenu_mac.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 354161d..c3b954f 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1413,7 +1413,7 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
SetMenuItemProperty(data.submenuHandle, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), &caused);
#else
NSMenu *subMenu = static_cast<NSMenu *>(action->action->menu()->macMenu());
- if ([subMenu supermenu] != nil) {
+ if ([subMenu supermenu] && [subMenu supermenu] != [item menu]) {
// The menu is already a sub-menu of another one. Cocoa will throw an exception,
// in such cases. For the time being, a new QMenu with same set of actions is the
// only workaround.
@@ -1686,7 +1686,7 @@ QMenuBarPrivate::QMacMenuBarPrivate::syncAction(QMacMenuAction *action)
GetMenuItemProperty(action->menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(caused), 0, &caused);
SetMenuItemProperty(submenu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), &caused);
#else
- if ([submenu supermenu] != nil)
+ if ([submenu supermenu] && [submenu supermenu] != [item menu])
return;
else
[item setSubmenu:submenu];