Debugger: Fix passing tooltips from to toolbuttons

Visible in the O and <> buttons of the Callgrind toolbar.

Change-Id: I1016f853335bfc243f7e934e7a0cd430922c8af6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-11-16 16:32:28 +01:00
parent 96db947c81
commit 898210f0a1
2 changed files with 2 additions and 0 deletions

View File

@@ -1324,6 +1324,7 @@ QAction *BoolAspect::action()
auto act = BaseAspect::action(); // Creates it.
act->setCheckable(true);
act->setChecked(value());
act->setToolTip(toolTip());
connect(act, &QAction::triggered, this, [this](bool newValue) {
// The check would be nice to have in simple conditions, but if we
// have an action that's used both on a settings page and as action

View File

@@ -834,6 +834,7 @@ QToolButton *PerspectivePrivate::setupToolButton(QAction *action)
auto toolButton = new QToolButton(m_innerToolBar);
toolButton->setProperty("panelwidget", true);
toolButton->setDefaultAction(action);
toolButton->setToolTip(action->toolTip());
m_innerToolBarLayout->addWidget(toolButton);
return toolButton;
}