diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-07-24 14:20:55 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-07-24 14:25:04 (GMT) |
commit | 4d99029334105f2df9f424fd0c4764cce3230ef0 (patch) | |
tree | b68673790d5a8c12f93372030210e40d6b42ecfc | |
parent | 11985909ddb17283e392244ee72ed54baa9a7339 (diff) | |
download | Qt-4d99029334105f2df9f424fd0c4764cce3230ef0.zip Qt-4d99029334105f2df9f424fd0c4764cce3230ef0.tar.gz Qt-4d99029334105f2df9f424fd0c4764cce3230ef0.tar.bz2 |
Fix missing mnemonics when triggering menus by shortcut
When opening a menu by shortcut on Windows, we would loose
the keyboard mnemonic when navigating around. This is incorrect
compared to native applications and somewhat inconvenient.
The fix is basically to enable the keyboard mode when shortcuts
are triggered, not only when the alt-key is pressed.
Task-number: 254496
Reviewed-by: denis
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 6b93879..1cfb9b3 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1758,6 +1758,9 @@ void QMenuBarPrivate::_q_internalShortcutActivated(int id) activateAction(act, QAction::Trigger); //100 is the same as the default value in QPushButton::animateClick autoReleaseTimer.start(100, q); + } else if (act && q->style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation, 0, q)) { + // When we open a menu using a shortcut, we should end up in keyboard state + setKeyboardMode(true); } } |