summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-07-24 14:20:55 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-07-24 14:25:04 (GMT)
commit4d99029334105f2df9f424fd0c4764cce3230ef0 (patch)
treeb68673790d5a8c12f93372030210e40d6b42ecfc
parent11985909ddb17283e392244ee72ed54baa9a7339 (diff)
downloadQt-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.cpp3
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);
}
}