macOS: Fix that Preferences do not work with german translation

By default Qt does heuristics on the menu item text, to decide the menu
role of an item, including whether the item should be used for the
Preferences entry in the application menu.

Now, "QML Profiler Options" is translated to "Einstellungen des QML-
Profilers" which matches the heuristics for the "Preferences" item,
replacing the actual Preferences.

For menu items we already force the menu role to NoRole if there hasn't
been a role explicitly set. Do that for the generated menus as well.

Change-Id: I4abb3f20fd51ef033e5ec68c2283af8b7b52927d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2018-11-07 10:47:12 +01:00
parent 3068bd3b80
commit 663d799166

View File

@@ -383,6 +383,7 @@ MenuActionContainer::MenuActionContainer(Id id)
m_menu(new QMenu)
{
m_menu->setObjectName(id.toString());
m_menu->menuAction()->setMenuRole(QAction::NoRole);
setOnAllDisabledBehavior(Disable);
}