diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-09-18 19:12:17 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-09-22 14:32:28 +0200 |
commit | 412ec70f14aa0c966d13481a35c498e6c905dec3 (patch) | |
tree | 6b7ab1135403093075257b4b5d05ca383ab59f24 /src/widgets/kernel | |
parent | 65a991e57e862e498fcae741f03ba1727a76fc80 (diff) |
OS X: Fix menu item shortcuts without modifiers
A regression was introduced by bdebec4e2ef79f1771d2dcc22f9a919eb4487567.
The intention of the change was to avoid using Qt's shortcut mechanism
to trigger menu items which were already triggered through the regular
menu API in Cocoa. However, Cocoa has trouble with key equivalents that
do not have any keyboard modifiers. Thus, we have to allow these
particular key sequences to go through the regular system. I've verified
that the original bug is still fixed with this change.
[ChangeLog][OS X] Fixed menu item shortcuts without keyboard
modifiers.
Task-number: QTBUG-41192
Change-Id: I8f5a9cbc7a448b3cb0519baed95be5cbb630205c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index dcf6aed591..3683d6c7ce 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -279,7 +279,7 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge // (and reaches this point), then the menu item itself has been disabled. // This occurs at the QPA level on Mac, were we disable all the Cocoa menus // when showing a modal window. - if (a->shortcut().count() <= 1) + if (a->shortcut().count() < 1 || (a->shortcut().count() == 1 && (a->shortcut()[0] & Qt::MODIFIER_MASK) != 0)) continue; #endif QAction *a = menu->menuAction(); |