Commit 605f5256 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Clarify interaction when expanding category labels



Change-Id: I22c106b1493ee323c6f8baf92faa0fd543386c9b
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent abcb7b06
......@@ -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);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment