Delete the children before updating the Cocoa menubar

When the Cocoa menubar is updated then it ensures that the merged native
menu items are visible if appropriate. However when the old menubar is
deleted then it causes the merged native items to be hidden. Therefore
we ensure the children are deleted first which causes the native items
to be hidden and then update the menubar so that they can be correctly
visible if they should be.

Change-Id: I426864a5d2ec1f34c03290ac66371b12bf77cc00
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Andy Shaw 2014-02-05 09:15:28 +01:00 committed by The Qt Project
parent 9b59e51c50
commit 93500422d1

View File

@ -79,6 +79,10 @@ QCocoaMenuBar::~QCocoaMenuBar()
if (m_window && m_window->menubar() == this) {
m_window->setMenubar(0);
// Delete the children first so they do not cause
// the native menu items to be hidden after
// the menu bar was updated
qDeleteAll(children());
updateMenuBarImmediately();
}
}