aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-01-24 10:37:02 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-01-25 12:00:05 +0000
commitcc213dbe495f26e20fa8163670f8e54d925e649b (patch)
tree43ef0d9f6d4f86c3f974495c71fd225d2887698d /src/plugins/qmlprofiler
parent8d6ccb08220957c79e3e0de9b065fcab89e3bce7 (diff)
Tracing: Add context menu option to reset the flame graph
The double-clicking-on-blank-space method is really hard to discover. Task-number: QTCREATORBUG-20732 Change-Id: I09e3189292c236fea0698e7cb68ea8340f9033fe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/flamegraphview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmlprofiler/flamegraphview.cpp b/src/plugins/qmlprofiler/flamegraphview.cpp
index 23e60a32b64..618c632292c 100644
--- a/src/plugins/qmlprofiler/flamegraphview.cpp
+++ b/src/plugins/qmlprofiler/flamegraphview.cpp
@@ -93,9 +93,14 @@ void FlameGraphView::contextMenuEvent(QContextMenuEvent *ev)
QAction *getGlobalStatsAction = menu.addAction(tr("Show Full Range"));
if (!m_model->modelManager()->isRestrictedToRange())
getGlobalStatsAction->setEnabled(false);
+ QAction *resetAction = menu.addAction(tr("Reset Flame Graph"));
+ resetAction->setEnabled(m_content->rootObject()->property("zoomed").toBool());
- if (menu.exec(position) == getGlobalStatsAction)
+ const QAction *selected = menu.exec(position);
+ if (selected == getGlobalStatsAction)
emit showFullRange();
+ else if (selected == resetAction)
+ QMetaObject::invokeMethod(m_content->rootObject(), "resetRoot");
}
} // namespace Internal