path: root/src/plugins
diff options
authorDaiwei Li <>2015-01-22 02:32:27 -0800
committerDaiwei Li <>2015-02-03 00:30:16 +0000
commitc96b5d2b062e2757772a81927936e2a81be41c8e (patch)
tree56d29530da2cde219a612029efb97047bb6f817f /src/plugins
parent392d8b5a75b4ac70b3dc4e856793771d86c50d82 (diff)
Cocoa: Keep menu invisible when adding it to a menubar
In MenuBar.qml, it's possible for __isNative to be set after visible on a child QQuickMenu. In that case, the will have set submenu to nil, only to be overridden in insertNativeMenu when __isNative is set. Change-Id: Id3c6bca03f937528d05b166cbd6a6d1011db43e8 Task-number: QTBUG-44168 Reviewed-by: Morten Johan Sørvig <>
Diffstat (limited to 'src/plugins')
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/ b/src/plugins/platforms/cocoa/
index aceb9b619b..0b46508782 100644
--- a/src/plugins/platforms/cocoa/
+++ b/src/plugins/platforms/cocoa/
@@ -100,7 +100,9 @@ void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu)
syncMenu(static_cast<QPlatformMenu *>(menu));
- [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()];
+ if (menu->isVisible()) {
+ [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()];
+ }
void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before)