QmlProfiler: Rebuild the flamegraph model when visible features change

This is more expensive than just setting the filtered items' height to
0. However, this way we implicitly also change the size of the root
element, group equal items that end up on the same level by filtering,
recalculate the cutoff for too small items and resort all items by
width.

Change-Id: Ida2c5acd9848c5644ecff052d78e9fe5ad962606
Task-number: QTCREATORBUG-18713
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2017-08-11 11:12:49 +02:00
parent e7c950eb11
commit 63551d7711
4 changed files with 39 additions and 14 deletions

View File

@@ -80,13 +80,7 @@ void FlameGraphView::selectByTypeId(int typeIndex)
void FlameGraphView::onVisibleFeaturesChanged(quint64 features)
{
int rangeTypeMask = 0;
for (int rangeType = 0; rangeType < MaximumRangeType; ++rangeType) {
if (features & (1ULL << featureFromRangeType(RangeType(rangeType))))
rangeTypeMask |= (1 << rangeType);
}
if (m_content->rootObject())
m_content->rootObject()->setProperty("visibleRangeTypes", rangeTypeMask);
m_model->restrictToFeatures(features);
}
void FlameGraphView::contextMenuEvent(QContextMenuEvent *ev)