From 605f5256544ae6e56f89c8d7dc8f302959795e9b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 13 Feb 2014 17:17:35 +0100 Subject: [PATCH] QmlProfiler: Clarify interaction when expanding category labels Change-Id: I22c106b1493ee323c6f8baf92faa0fd543386c9b Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qml/CategoryLabel.qml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml index 0ea83dc7aa2..5f996e398a2 100644 --- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml +++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml @@ -45,20 +45,11 @@ Item { height: root.singleRowHeight width: 150 - onExpandedChanged: { - qmlProfilerModelProxy.setExpanded(modelIndex, categoryIndex, expanded); - backgroundMarks.requestPaint(); - getDescriptions(); - updateHeight(); - } - Component.onCompleted: { updateHeight(); } function updateHeight() { - if (expanded != qmlProfilerModelProxy.expanded(modelIndex, categoryIndex)) - expanded = qmlProfilerModelProxy.expanded(modelIndex, categoryIndex); height = root.singleRowHeight * qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex); } @@ -85,7 +76,9 @@ Item { Connections { target: qmlProfilerModelProxy onExpandedChanged: { - updateHeight(); + expanded = qmlProfilerModelProxy.expanded(modelIndex, categoryIndex); + backgroundMarks.requestPaint(); + getDescriptions(); } onStateChanged: { @@ -159,7 +152,9 @@ Item { anchors.topMargin: -10 anchors.bottomMargin: -10 onClicked: { - expanded = !expanded; + // Don't try to expand empty models. + if (expanded || qmlProfilerModelProxy.count(modelIndex) > 0) + qmlProfilerModelProxy.setExpanded(modelIndex, categoryIndex, !expanded); } } }