0000965: Tooltips should include shortcuts keys in parentheses

This commit is contained in:
wmayer 2013-05-14 16:26:44 +02:00
parent 81045486fd
commit 672e4d0feb

View File

@ -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