diff options
author | Andy Shaw <andy.shaw@digia.com> | 2014-02-05 09:15:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 18:11:20 +0100 |
commit | 93500422d120d1090e60f6d1c0ad75fe30d4e806 (patch) | |
tree | 20520fc7e535bd8a787d5387dabb8d23595b833b /src/plugins/platforms/cocoa/qcocoamenubar.mm | |
parent | 9b59e51c5064c67c423389c2c884d009903910c7 (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenubar.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoamenubar.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 5a8664747e..7335deb800 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -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(); } } |