summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoamenubar.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-16 16:02:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-16 16:02:19 +0200
commite72785547696146f6172f0ef2824033e17df7b50 (patch)
treee78d6bafd7b3bcd9e786b5da8150cf02dcf2b4bb /src/plugins/platforms/cocoa/qcocoamenubar.mm
parentac5c64fccd6d491ee3b3a3f54460ed3464d714fc (diff)
parent5c23199d4e8ff21661dfa5aacc13149178e78cab (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenubar.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index da2704f19c..0fea55ac68 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -149,15 +149,17 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu)
Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items())
cocoaMenu->syncMenuItem(item);
- // If the NSMenu has no visble items, or only separators, we should hide it
- // on the menubar. This can happen after syncing the menu items since they
- // can be moved to other menus.
BOOL shouldHide = YES;
- for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray])
- if (![item isSeparatorItem] && ![item isHidden]) {
- shouldHide = NO;
- break;
- }
+ if (cocoaMenu->isVisible()) {
+ // If the NSMenu has no visble items, or only separators, we should hide it
+ // on the menubar. This can happen after syncing the menu items since they
+ // can be moved to other menus.
+ for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray])
+ if (![item isSeparatorItem] && ![item isHidden]) {
+ shouldHide = NO;
+ break;
+ }
+ }
[cocoaMenu->nsMenuItem() setHidden:shouldHide];
}