diff options
-rw-r--r-- | src/libs/tracing/flamegraph.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libs/tracing/flamegraph.cpp b/src/libs/tracing/flamegraph.cpp index 9d7df037f5..0e454cdbb7 100644 --- a/src/libs/tracing/flamegraph.cpp +++ b/src/libs/tracing/flamegraph.cpp @@ -185,11 +185,13 @@ void FlameGraph::rebuild() return; } - if (m_root.isValid()) { - QObject *parentObject = appendChild(this, this, qmlContext(this), m_root, 0, 1); - m_depth = buildNode(m_root, parentObject, 1, m_maximumDepth); - } else { - m_depth = buildNode(m_root, this, 0, m_maximumDepth); + if (m_model->data(m_root, m_sizeRole).toReal() > 0) { + if (m_root.isValid()) { + QObject *parentObject = appendChild(this, this, qmlContext(this), m_root, 0, 1); + m_depth = buildNode(m_root, parentObject, 1, m_maximumDepth); + } else { + m_depth = buildNode(m_root, this, 0, m_maximumDepth); + } } emit depthChanged(m_depth); |