From 4d99029334105f2df9f424fd0c4764cce3230ef0 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 24 Jul 2009 16:20:55 +0200 Subject: 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 --- src/gui/widgets/qmenubar.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); } } -- cgit v0.12