aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2018-05-15 08:58:01 +0200
committerChristian Stenger <christian.stenger@qt.io>2018-05-15 12:03:57 +0000
commite3fb05739714da5858f675c1276eebe53c32a108 (patch)
tree49fb5ff20a9e13d8358769b8c48ae739dd72cf05 /src
parent607a3dd678841d9fcb45849d4945724ca13955ca (diff)
Valgrind: Add clear button to callgrind tool
Callgrind runs can spread TextMarks across files. Only way to get rid of them would be to start a new analyze and stop it before it can add new TextMarks. Be user-friendly and allow clearing the data including the TextMarks explicitly. Change-Id: If8d5c5f789414709a110249377ce907466c0fdf1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/valgrind/callgrindtool.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
index 294e28e665..2903b3cae5 100644
--- a/src/plugins/valgrind/callgrindtool.cpp
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -217,6 +217,7 @@ public:
QAction *m_dumpAction = nullptr;
QAction *m_resetAction = nullptr;
QAction *m_pauseAction = nullptr;
+ QAction *m_discardAction = nullptr;
QString m_toggleCollectFunction;
bool m_toolBusy = false;
@@ -392,6 +393,15 @@ CallgrindTool::CallgrindTool()
action->setToolTip(tr("Pause event logging. No events are counted which will speed up program execution during profiling."));
connect(action, &QAction::toggled, this, &CallgrindTool::pauseToggled);
+ // discard data action
+ m_discardAction = action = new QAction(this);
+ action->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon());
+ action->setToolTip(tr("Discard Data"));
+ connect(action, &QAction::triggered, this, [this](bool) {
+ clearTextMarks();
+ doClear(true);
+ });
+
// navigation
// go back
m_goBack = action = new QAction(this);
@@ -421,6 +431,7 @@ CallgrindTool::CallgrindTool()
toolbar.addAction(m_dumpAction);
toolbar.addAction(m_resetAction);
toolbar.addAction(m_pauseAction);
+ toolbar.addAction(m_discardAction);
toolbar.addAction(m_goBack);
toolbar.addAction(m_goNext);
toolbar.addWidget(new Utils::StyledSeparator);