fix: Tooltips for no-shortcut actions is not correct

This commit is contained in:
Roy Qu 2023-03-17 17:57:49 +08:00
parent a088c29b67
commit af80ee04c4
1 changed files with 2 additions and 2 deletions

View File

@ -126,8 +126,8 @@ void ShortcutManager::applyTo(QAction *action)
PEnvironmentShortcut item = mShortcuts.value(action->objectName(), PEnvironmentShortcut());
if (item && item->isAction) {
action->setShortcut(QKeySequence::fromString(item->shortcut));
action->setToolTip(action->text()+QString("(%1)").arg(item->shortcut));
} else if (!action->shortcut().isEmpty()){
}
if (!action->shortcut().isEmpty()){
action->setToolTip(action->text()+QString("(%1)").arg(action->shortcut().toString()));
} else {
action->setToolTip(action->text());