path: root/tests/manual
diff options
authorGabriel de Dietrich <>2017-10-20 17:39:08 +0700
committerGabriel de Dietrich <>2017-11-05 01:39:30 +0000
commit385589ef458715fcaa533bbd01ca421dc1040eba (patch)
tree1c7f88ee91ad1277e400a54aac252159e765c734 /tests/manual
parentb35a27676bec7f79761be83b2a7764ac0470e789 (diff)
QCocoaMenu: Attach menu items when updating the menubar
Instead of waiting for the menu delegate to update each item, we can attach an NSMenu to its NSMenuItem as soon as we update the current window's menubar. This is safe to do because we know that this is going to be the main menubar right after, so we're not orphaning any NSMenuItem from its NSMenu at the wrong moment. By doing this, we also ensure that all menus from the active menubar are reachable by the key-equivalent dispatching logic, even before we display the actual menu. This was shown in BigMenuCreator where, under the menubar's ASP and SAP menus, all A*S submenus would be disabled. Furthermore, on the same menus, SAP would show the same issue. Added test in Menurama as well. Change-Id: If6e7311072e6b53ad1cbced73623d1832aa0df8e Task-number: QTBUG-57076 Task-number: QTBUG-63712 Reviewed-by: Morten Johan Sørvig <>
Diffstat (limited to 'tests/manual')
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/manual/cocoa/menurama/mainwindow.cpp b/tests/manual/cocoa/menurama/mainwindow.cpp
index 06867bd7c9..086fc1e2fa 100644
--- a/tests/manual/cocoa/menurama/mainwindow.cpp
+++ b/tests/manual/cocoa/menurama/mainwindow.cpp
@@ -37,6 +37,11 @@ MainWindow::MainWindow(QWidget *parent) :
+ auto *a = ui->menuStuff->addAction("Enabled Submenu (QTBUG-63172)");
+ auto *qtbug63172_Menu = new QMenu;
+ qtbug63172_Menu->addAction("We're Good!");
+ a->setMenu(qtbug63172_Menu);
connect(ui->menuAfter_aboutToShow, &QMenu::aboutToShow, [=] {
diff --git a/tests/manual/cocoa/menurama/mainwindow.ui b/tests/manual/cocoa/menurama/mainwindow.ui
index 18cded70d2..4fb3e3420e 100644
--- a/tests/manual/cocoa/menurama/mainwindow.ui
+++ b/tests/manual/cocoa/menurama/mainwindow.ui
@@ -131,6 +131,7 @@ Click on &quot;Dynamic Stuff&quot; then move left and right to other menus. Disa
<addaction name="menuSubmenu"/>
<addaction name="actionDisabled_Item"/>
<addaction name="menuDisabled_Submenu"/>
+ <addaction name="separator"/>
<widget class="QMenu" name="menuDisabled_Stuff">
<property name="enabled">