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 qcocoamenu.mm 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 <morten.sorvig@theqtcompany.com>
This commit is contained in:
parent
392d8b5a75
commit
c96b5d2b06
@ -100,7 +100,9 @@ void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu)
|
|||||||
|
|
||||||
menu->setMenuBar(this);
|
menu->setMenuBar(this);
|
||||||
syncMenu(static_cast<QPlatformMenu *>(menu));
|
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)
|
void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user