forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user