Workaround Qt 5 macOS menu bug

With Qt => 5.9, it would randomly crash when opening a menu after changing workbenches.
Evidently it is a Qt macOS bug related to removing actions from menus.
Recreating the menus everytime avoids the issue.
This commit is contained in:
Peter Lama
2018-03-22 09:47:54 -07:00
parent 4108674c66
commit 7db8de70e1

View File

@@ -191,7 +191,11 @@ void MenuManager::setup(MenuItem* menuItems) const
return; // empty menu bar
QMenuBar* menuBar = getMainWindow()->menuBar();
//menuBar->setUpdatesEnabled(false);
#ifdef FC_OS_MACOSX
// Unknown Qt macOS bug observed with Qt >= 5.9.4 causes random crashes when viewing reused top level menus.
menuBar->clear();
#endif
QList<MenuItem*> items = menuItems->getItems();
QList<QAction*> actions = menuBar->actions();