QmlProfiler: Clarify interaction when expanding category labels

Change-Id: I22c106b1493ee323c6f8baf92faa0fd543386c9b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-02-13 17:17:35 +01:00
parent abcb7b0604
commit 605f525654

View File

@@ -45,20 +45,11 @@ Item {
height: root.singleRowHeight height: root.singleRowHeight
width: 150 width: 150
onExpandedChanged: {
qmlProfilerModelProxy.setExpanded(modelIndex, categoryIndex, expanded);
backgroundMarks.requestPaint();
getDescriptions();
updateHeight();
}
Component.onCompleted: { Component.onCompleted: {
updateHeight(); updateHeight();
} }
function updateHeight() { function updateHeight() {
if (expanded != qmlProfilerModelProxy.expanded(modelIndex, categoryIndex))
expanded = qmlProfilerModelProxy.expanded(modelIndex, categoryIndex);
height = root.singleRowHeight * qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex); height = root.singleRowHeight * qmlProfilerModelProxy.categoryDepth(modelIndex, categoryIndex);
} }
@@ -85,7 +76,9 @@ Item {
Connections { Connections {
target: qmlProfilerModelProxy target: qmlProfilerModelProxy
onExpandedChanged: { onExpandedChanged: {
updateHeight(); expanded = qmlProfilerModelProxy.expanded(modelIndex, categoryIndex);
backgroundMarks.requestPaint();
getDescriptions();
} }
onStateChanged: { onStateChanged: {
@@ -159,7 +152,9 @@ Item {
anchors.topMargin: -10 anchors.topMargin: -10
anchors.bottomMargin: -10 anchors.bottomMargin: -10
onClicked: { onClicked: {
expanded = !expanded; // Don't try to expand empty models.
if (expanded || qmlProfilerModelProxy.count(modelIndex) > 0)
qmlProfilerModelProxy.setExpanded(modelIndex, categoryIndex, !expanded);
} }
} }
} }