forked from qt-creator/qt-creator
Tracing: Don't rebuild flame graph if there is nothing to see
If the root size is 0, none of the nodes will be visible. Don't create them in the first place. Task-number: QTCREATORBUG-20772 Change-Id: I9595daece2d17fe8202b322ffafd361d6fa422fa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -185,11 +185,13 @@ void FlameGraph::rebuild()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_root.isValid()) {
|
if (m_model->data(m_root, m_sizeRole).toReal() > 0) {
|
||||||
QObject *parentObject = appendChild(this, this, qmlContext(this), m_root, 0, 1);
|
if (m_root.isValid()) {
|
||||||
m_depth = buildNode(m_root, parentObject, 1, m_maximumDepth);
|
QObject *parentObject = appendChild(this, this, qmlContext(this), m_root, 0, 1);
|
||||||
} else {
|
m_depth = buildNode(m_root, parentObject, 1, m_maximumDepth);
|
||||||
m_depth = buildNode(m_root, this, 0, m_maximumDepth);
|
} else {
|
||||||
|
m_depth = buildNode(m_root, this, 0, m_maximumDepth);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit depthChanged(m_depth);
|
emit depthChanged(m_depth);
|
||||||
|
Reference in New Issue
Block a user