Commit bac3b888 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Show note indication in category labels

Change-Id: I9bcb9bcaab6d24c87c932fce610a6026461a5ecb
Reviewed-by: default avatarKai Koehne <kai.koehne@theqtcompany.com>
parent a466a3eb
......@@ -193,6 +193,48 @@ Item {
}
}
ToolButton {
id: notesButton
anchors.verticalCenter: txt.verticalCenter
anchors.right: expandButton.left
implicitWidth: 17
implicitHeight: txt.height - 1
property var eventIds: []
property var texts: []
property int currentNote: -1
Connections {
target: qmlProfilerModelProxy
onModelsChanged: notesButton.updateNotes()
onNotesChanged: {
if (arguments[1] === -1 || arguments[1] === modelIndex)
notesButton.updateNotes();
}
}
function updateNotes() {
var notes = qmlProfilerModelProxy.notesByTimelineModel(modelIndex);
var newTexts = [];
var newEventIds = [];
for (var i in notes) {
newTexts.push(qmlProfilerModelProxy.noteText(notes[i]))
newEventIds.push(qmlProfilerModelProxy.noteTimelineIndex(notes[i]));
}
// Bindings are only triggered when assigning the whole array.
eventIds = newEventIds;
texts = newTexts;
}
visible: eventIds.length > 0
iconSource: "ico_note.png"
tooltip: texts.join("\n");
onClicked: {
if (++currentNote >= eventIds.length)
currentNote = 0;
view.selectFromEventIndex(modelIndex, eventIds[currentNote]);
}
}
ToolButton {
id: expandButton
anchors.verticalCenter: txt.verticalCenter
......
......@@ -27,6 +27,7 @@
<file>ico_next.png</file>
<file>ico_rangeselection.png</file>
<file>ico_rangeselected.png</file>
<file>ico_note.png</file>
<file>ButtonsBar.qml</file>
<file>ico_filter.png</file>
</qresource>
......
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