From 38785ddd9669440ff3ae99d749a2cec80a753a6d Mon Sep 17 00:00:00 2001 From: matt-taylor-git <64795758+matt-taylor-git@users.noreply.github.com> Date: Fri, 19 Sep 2025 11:20:39 -0400 Subject: [PATCH] Fix: Update tooltip for grouped commands (#24043) When a command is part of a toolbar group, the tooltip for the group's button was not correctly updated with the shortcut of the selected command. This was happening because the tooltip generation was using the shortcut of the group itself, not the selected child command. This commit fixes the issue by ensuring that the tooltip of the group action is updated with the full tooltip of the child action, which already contains the correct shortcut information. This is done in both 'ActionGroup::onActivated' (for when a new tool is selected) and 'ActionGroup::setCheckedAction' (for the initial default tool). --- src/Gui/Action.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index f26155f401..4d095e8e3e 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -565,7 +565,7 @@ void ActionGroup::setCheckedAction(int index) this->setIcon(act->icon()); if (!this->_isMode) { - this->setToolTip(act->toolTip(), act->text()); + this->action()->setToolTip(act->toolTip()); } this->setProperty("defaultAction", QVariant(index)); } @@ -594,7 +594,7 @@ void ActionGroup::onActivated (QAction* act) this->setIcon(act->icon()); if (!this->_isMode) { - this->setToolTip(act->toolTip(), act->text()); + this->action()->setToolTip(act->toolTip()); } this->setProperty("defaultAction", QVariant(index)); command()->invoke(index, Command::TriggerChildAction);