From 268f672d90f19fa149e2432c28564d6fa4e1e242 Mon Sep 17 00:00:00 2001 From: Joona Date: Sun, 26 Jan 2025 15:45:14 +0200 Subject: [PATCH] Added set shortcut to group command's Setup function Implemented set shortcut in the group command's Setup function. This change allows the group command icon to display the tool's shortcut, but the shortcut appears only after the tool is selected once. --- src/Gui/Command.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index 848e71a1e8..60d3fa45d7 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -1121,6 +1121,8 @@ void GroupCommand::setup(Action *pcAction) { int idx = pcAction->property("defaultAction").toInt(); if(idx>=0 && idx<(int)cmds.size() && cmds[idx].first) { auto cmd = cmds[idx].first; + QString shortcut = cmd->getShortcut(); + pcAction->setShortcut(shortcut); pcAction->setText(QCoreApplication::translate(className(), getMenuText())); QIcon icon; if (auto childAction = cmd->getAction())