QmlProfiler: next and previous buttons have now consistent behaviour

Having them behave differently depending on the locked mode was
confusing.  This patch moves that functionality to the event labels,
thus next and prev just select next and previous events in the
timeline, in strict chronological order.

Change-Id: I5bd996199dd6a4af4c65e3205493f17495d0135b
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
This commit is contained in:
Christiaan Janssen
2011-11-23 16:17:33 +01:00
parent 02bbf4ff9b
commit 37161a4194
5 changed files with 102 additions and 66 deletions

View File

@@ -39,6 +39,7 @@ Item {
property int typeIndex: index
property variant descriptions: []
property variant eventIds: []
height: root.singleRowHeight
width: 150
@@ -48,7 +49,7 @@ Item {
rE[typeIndex] = expanded;
labels.rowExpanded = rE;
backgroundMarks.requestRedraw();
view.rowExpanded(typeIndex, expanded);
view.setRowExpanded(typeIndex, expanded);
updateHeight();
}
@@ -65,13 +66,18 @@ Item {
target: qmlEventList
onDataReady: {
var desc=[];
for (var i=0; i<qmlEventList.uniqueEventsOfType(typeIndex); i++)
var ids=[];
for (var i=0; i<qmlEventList.uniqueEventsOfType(typeIndex); i++) {
desc[i] = qmlEventList.eventTextForType(typeIndex, i);
ids[i] = qmlEventList.eventIdForType(typeIndex, i);
}
descriptions = desc;
eventIds = ids;
updateHeight();
}
onDataClear: {
descriptions = [];
eventIds = [];
updateHeight();
}
}
@@ -113,6 +119,15 @@ Item {
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
MouseArea {
anchors.fill: parent
onClicked: {
if (mouse.modifiers & Qt.ShiftModifier)
view.selectPrevFromId(eventIds[index]);
else
view.selectNextFromId(eventIds[index]);
}
}
}
}
}