Set parents for menus in the main menu bar

Shouldn't be necessary because the MenuActionContainer takes care of
deletion if it wasn't deleted before, but works around issues with
placing menu popups with Qt Wayland (QTBUG-68636)

Task-number: QTCREATORBUG-20516
Change-Id: Ib1d393abc78b145905429e64f8bf7541af75bdad
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Eike Ziller
2018-06-14 15:04:52 +02:00
parent 5f9f8f9f16
commit dccf5a5ae7

View File

@@ -403,6 +403,7 @@ void MenuActionContainer::insertAction(QAction *before, QAction *action)
void MenuActionContainer::insertMenu(QAction *before, QMenu *menu) void MenuActionContainer::insertMenu(QAction *before, QMenu *menu)
{ {
menu->setParent(m_menu, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636)
m_menu->insertMenu(before, menu); m_menu->insertMenu(before, menu);
} }
@@ -509,6 +510,7 @@ void MenuBarActionContainer::insertAction(QAction *before, QAction *action)
void MenuBarActionContainer::insertMenu(QAction *before, QMenu *menu) void MenuBarActionContainer::insertMenu(QAction *before, QMenu *menu)
{ {
menu->setParent(m_menuBar, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636)
m_menuBar->insertMenu(before, menu); m_menuBar->insertMenu(before, menu);
} }