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:
Alessandro Portale
2016-03-31 13:32:08 +02:00
parent eeb566ef74
commit 52a6e03942

View File

@@ -412,7 +412,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
// Cost formatting
{
auto menu = new QMenu;
auto group = new QActionGroup(this);
// Show costs as absolute numbers
@@ -422,7 +421,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
m_costAbsolute->setChecked(true);
connect(m_costAbsolute, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
group->addAction(m_costAbsolute);
menu->addAction(m_costAbsolute);
// Show costs in percentages
m_costRelative = new QAction(tr("Relative Costs"), this);
@@ -430,7 +428,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
m_costRelative->setCheckable(true);
connect(m_costRelative, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
group->addAction(m_costRelative);
menu->addAction(m_costRelative);
// Show costs relative to parent
m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this);
@@ -438,11 +435,9 @@ CallgrindTool::CallgrindTool(QObject *parent)
m_costRelativeToParent->setCheckable(true);
connect(m_costRelativeToParent, &QAction::toggled, this, &CallgrindTool::updateCostFormat);
group->addAction(m_costRelativeToParent);
menu->addAction(m_costRelativeToParent);
auto button = new QToolButton;
button->setMenu(menu);
menu->setParent(button);
button->addActions(group->actions());
button->setPopupMode(QToolButton::InstantPopup);
button->setText(QLatin1String("$"));
button->setToolTip(tr("Cost Format"));