summaryrefslogtreecommitdiff
path: root/src/plugins/qmlprofiler/qml/Label.qml
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@nokia.com>2011-10-26 11:32:01 +0200
committerChristiaan Janssen <christiaan.janssen@nokia.com>2011-11-02 10:14:09 +0100
commitbf4dfd5e74ed42af5bd6b4047813cb93682b5b10 (patch)
tree43e3db06f59460905eda7f523ca184c2d8b6f5e5 /src/plugins/qmlprofiler/qml/Label.qml
parent38ad15a7728de7691087d255d76e50d6df2e9efd (diff)
downloadqt-creator-bf4dfd5e74ed42af5bd6b4047813cb93682b5b10.tar.gz
QmlProfiler: optimized timeline display
Change-Id: I0d7cf110356ef5f805b81a5fc39dca3870765ea3 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qml/Label.qml')
-rw-r--r--src/plugins/qmlprofiler/qml/Label.qml74
1 files changed, 71 insertions, 3 deletions
diff --git a/src/plugins/qmlprofiler/qml/Label.qml b/src/plugins/qmlprofiler/qml/Label.qml
index abe28391bb..a9f3594ad1 100644
--- a/src/plugins/qmlprofiler/qml/Label.qml
+++ b/src/plugins/qmlprofiler/qml/Label.qml
@@ -34,12 +34,53 @@ import QtQuick 1.0
Item {
property alias text: txt.text
+ property bool expanded: false
+ property int typeIndex: index
- height: 50
- width: 150 //### required, or ignored by positioner
+ property variant descriptions: [text]
+
+ height: root.singleRowHeight
+ width: 150
+
+ onExpandedChanged: {
+ var rE = labels.rowExpanded;
+ rE[typeIndex] = expanded;
+ labels.rowExpanded = rE;
+ backgroundMarks.requestPaint();
+ view.rowExpanded(typeIndex, expanded);
+ updateHeight();
+ }
+
+ Component.onCompleted: {
+ updateHeight();
+ }
+
+ function updateHeight() {
+ height = root.singleRowHeight *
+ (expanded ? qmlEventList.uniqueEventsOfType(typeIndex) : qmlEventList.maxNestingForType(typeIndex));
+ }
+
+ Connections {
+ target: qmlEventList
+ onDataReady: {
+ var desc=[];
+ for (var i=0; i<qmlEventList.uniqueEventsOfType(typeIndex); i++)
+ desc[i] = qmlEventList.eventTextForType(typeIndex, i);
+ // special case: empty
+ if (desc.length == 1 && desc[0]=="")
+ desc[0] = text;
+ descriptions = desc;
+ updateHeight();
+ }
+ onDataClear: {
+ descriptions = [text];
+ updateHeight();
+ }
+ }
Text {
- id: txt;
+ id: txt
+ visible: !expanded
x: 5
font.pixelSize: 12
color: "#232323"
@@ -52,4 +93,31 @@ Item {
color: "#cccccc"
anchors.bottom: parent.bottom
}
+
+ Column {
+ visible: expanded
+ Repeater {
+ model: descriptions.length
+ Text {
+ height: root.singleRowHeight
+ x: 5
+ width: 140
+ text: descriptions[index]
+ elide: Text.ElideRight
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ Image {
+ source: expanded ? "arrow_down.png" : "arrow_right.png"
+ x: parent.width - 12
+ y: 2
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ expanded = !expanded;
+ }
+ }
+ }
}