summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-03-20 15:45:02 +0100
committerAndy Shaw <andy.shaw@qt.io>2019-03-21 14:21:49 +0000
commit4daf5204babc62a7ae58b6de5c09c527f81ea27c (patch)
treecff8864dc58c9594dd04b7048269cd513f5d33f9
parenta1c37462eebddf4ad7bc3192f1f3e9a3f7292b19 (diff)
Cocoa: Clear the shortcut used when hiding a native menu entry
The shortcut needs to be cleared if the native menu entry is being hidden due to the fact it was changed. Otherwise it will not show the shortcut anymore as it sees it as in-use. Change-Id: Ifb10db855766e4de71db06ea006f6d63497f3193 Fixes: QTBUG-74113 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 7b96fca3f9..f34988721d 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -250,6 +250,9 @@ void QCocoaMenu::syncMenuItem_helper(QPlatformMenuItem *menuItem, bool menubarUp
if (wasMerged) {
oldItem.enabled = NO;
oldItem.hidden = YES;
+ oldItem.keyEquivalent = @"";
+ oldItem.keyEquivalentModifierMask = NSEventModifierFlagCommand;
+
} else {
[m_nativeMenu removeItem:oldItem];
}