diff options
| -rw-r--r-- | src/plugins/Ui/qsui/actionmanager.cpp | 6 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/actionmanager.cpp | 3 | ||||
| -rw-r--r-- | src/qmmpui/uihelper.cpp | 5 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/Ui/qsui/actionmanager.cpp b/src/plugins/Ui/qsui/actionmanager.cpp index 5e7eb8977..51399d1ca 100644 --- a/src/plugins/Ui/qsui/actionmanager.cpp +++ b/src/plugins/Ui/qsui/actionmanager.cpp @@ -147,6 +147,9 @@ ActionManager* ActionManager::instance() QAction *ActionManager::createAction(QString name, QString confKey, QString key, QString iconName) { QAction *action = new QAction(name, this); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + action->setShortcutVisibleInContextMenu(true); +#endif action->setShortcut(m_settings->value(confKey, key).toString()); action->setObjectName(confKey); action->setProperty("defaultShortcut", key); @@ -219,6 +222,9 @@ void ActionManager::registerAction(int id, QAction *action, QString confKey, QSt action->setShortcut(settings.value(confKey, key).toString()); action->setProperty("defaultShortcut", key); action->setObjectName(confKey); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + action->setShortcutVisibleInContextMenu(true); +#endif m_actions[id] = action; settings.endGroup(); } diff --git a/src/plugins/Ui/skinned/actionmanager.cpp b/src/plugins/Ui/skinned/actionmanager.cpp index 02158089c..8ee1fb667 100644 --- a/src/plugins/Ui/skinned/actionmanager.cpp +++ b/src/plugins/Ui/skinned/actionmanager.cpp @@ -139,6 +139,9 @@ ActionManager* ActionManager::instance() QAction *ActionManager::createAction(QString name, QString confKey, QString key, QString iconName) { QAction *action = new QAction(name, this); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + action->setShortcutVisibleInContextMenu(true); +#endif action->setShortcut(m_settings->value(confKey, key).toString()); action->setProperty("defaultShortcut", key); action->setObjectName(confKey); diff --git a/src/qmmpui/uihelper.cpp b/src/qmmpui/uihelper.cpp index 5ae9e9184..0aadd0b24 100644 --- a/src/qmmpui/uihelper.cpp +++ b/src/qmmpui/uihelper.cpp @@ -71,7 +71,12 @@ void UiHelper::addAction(QAction *action, MenuType type) connect(action, SIGNAL(destroyed (QObject *)), SLOT(removeAction(QObject*))); if(!m_menus[type].actions.contains(action)) + { m_menus[type].actions.append(action); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + action->setShortcutVisibleInContextMenu(true); +#endif + } if(m_menus[type].menu && !m_menus[type].menu->actions().contains(action)) { if(m_menus[type].before) |
