From 672e4d0feba8bb6e73ee20b8573abc17741763af Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 14 May 2013 16:26:44 +0200 Subject: [PATCH] 0000965: Tooltips should include shortcuts keys in parentheses --- src/Gui/Command.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index 2fc6f8748..f1c4439d2 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -581,6 +581,12 @@ void Command::applyCommandData(Action* action) action->setWhatsThis(QCoreApplication::translate( this->className(), sToolTipText, 0, QCoreApplication::UnicodeUTF8)); + QString accel = action->shortcut().toString(); + if (!accel.isEmpty()) { + QString tip = QString::fromAscii("(%1)\t%2") + .arg(accel).arg(action->statusTip()); + action->setStatusTip(tip); + } } const char* Command::keySequenceToAccel(int sk) const