[PD] add shortcut to context menus

- people should be informed that there is a shortcut available (that was recently added)
- make the shortcut also translatable since "Del" means nothing in e.g. German
- minor code style fix in TaskDressUpParameters.h
This commit is contained in:
donovaly
2020-02-14 01:28:50 +01:00
committed by wmayer
parent 7b6e51c727
commit 0310a99f4e
11 changed files with 51 additions and 11 deletions

View File

@@ -113,7 +113,11 @@ void TaskLinearPatternParameters::setupUI()
// Create context menu
QAction* action = new QAction(tr("Remove"), this);
action->setShortcut(QString::fromLatin1("Del"));
action->setShortcut(tr("Del"));
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
// display shortcut behind the context menu entry
action->setShortcutVisibleInContextMenu(true);
#endif
ui->listWidgetFeatures->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(onFeatureDeleted()));
ui->listWidgetFeatures->setContextMenuPolicy(Qt::ActionsContextMenu);