forked from qt-creator/qt-creator
Valgrind: Fix callgrind's "Cost format" button
Broke after 0a89b89065
Correct fix seems to me to avoid the whole menu.
Change-Id: I59f1eb859c9045fc5ae9ac1b377b7e69b29af7ae
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -412,7 +412,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
|
|||||||
|
|
||||||
// Cost formatting
|
// Cost formatting
|
||||||
{
|
{
|
||||||
auto menu = new QMenu;
|
|
||||||
auto group = new QActionGroup(this);
|
auto group = new QActionGroup(this);
|
||||||
|
|
||||||
// Show costs as absolute numbers
|
// Show costs as absolute numbers
|
||||||
@@ -422,7 +421,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
|
|||||||
m_costAbsolute->setChecked(true);
|
m_costAbsolute->setChecked(true);
|
||||||
connect(m_costAbsolute, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
|
connect(m_costAbsolute, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
|
||||||
group->addAction(m_costAbsolute);
|
group->addAction(m_costAbsolute);
|
||||||
menu->addAction(m_costAbsolute);
|
|
||||||
|
|
||||||
// Show costs in percentages
|
// Show costs in percentages
|
||||||
m_costRelative = new QAction(tr("Relative Costs"), this);
|
m_costRelative = new QAction(tr("Relative Costs"), this);
|
||||||
@@ -430,7 +428,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
|
|||||||
m_costRelative->setCheckable(true);
|
m_costRelative->setCheckable(true);
|
||||||
connect(m_costRelative, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
|
connect(m_costRelative, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
|
||||||
group->addAction(m_costRelative);
|
group->addAction(m_costRelative);
|
||||||
menu->addAction(m_costRelative);
|
|
||||||
|
|
||||||
// Show costs relative to parent
|
// Show costs relative to parent
|
||||||
m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this);
|
m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this);
|
||||||
@@ -438,11 +435,9 @@ CallgrindTool::CallgrindTool(QObject *parent)
|
|||||||
m_costRelativeToParent->setCheckable(true);
|
m_costRelativeToParent->setCheckable(true);
|
||||||
connect(m_costRelativeToParent, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
|
connect(m_costRelativeToParent, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
|
||||||
group->addAction(m_costRelativeToParent);
|
group->addAction(m_costRelativeToParent);
|
||||||
menu->addAction(m_costRelativeToParent);
|
|
||||||
|
|
||||||
auto button = new QToolButton;
|
auto button = new QToolButton;
|
||||||
button->setMenu(menu);
|
button->addActions(group->actions());
|
||||||
menu->setParent(button);
|
|
||||||
button->setPopupMode(QToolButton::InstantPopup);
|
button->setPopupMode(QToolButton::InstantPopup);
|
||||||
button->setText(QLatin1String("$"));
|
button->setText(QLatin1String("$"));
|
||||||
button->setToolTip(tr("Cost Format"));
|
button->setToolTip(tr("Cost Format"));
|
||||||
|
|||||||
Reference in New Issue
Block a user