diff options
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index ff4cb71..3104083 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1229,7 +1229,9 @@ void qt_mac_menu_collapseSeparators(void */*NSMenu **/ theMenu, bool collapse) if (previousItem && previousIsSeparator) [previousItem setHidden:YES]; } else { - for (NSMenuItem *item in [menu itemArray]) { + NSArray *itemArray = [menu itemArray]; + for (unsigned int i = 0; i < [itemArray count]; ++i) { + NSMenuItem *item = reinterpret_cast<NSMenuItem *>([itemArray objectAtIndex:i]); if (QAction *action = reinterpret_cast<QAction *>([item tag])) [item setHidden:!action->isVisible()]; } |