OS X: Fix menu item shortcuts without modifiers
A regression was introduced by bdebec4e2e
.
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>
This commit is contained in:
parent
65a991e57e
commit
412ec70f14
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user