diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml
index ae716c2216f..3550d7d27b5 100644
--- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml
+++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml
@@ -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
diff --git a/src/plugins/qmlprofiler/qml/ico_note.png b/src/plugins/qmlprofiler/qml/ico_note.png
new file mode 100644
index 00000000000..fa5c2b5bc95
Binary files /dev/null and b/src/plugins/qmlprofiler/qml/ico_note.png differ
diff --git a/src/plugins/qmlprofiler/qml/qmlprofiler.qrc b/src/plugins/qmlprofiler/qml/qmlprofiler.qrc
index 51f55b7d6fb..0e13b920550 100644
--- a/src/plugins/qmlprofiler/qml/qmlprofiler.qrc
+++ b/src/plugins/qmlprofiler/qml/qmlprofiler.qrc
@@ -27,6 +27,7 @@
ico_next.png
ico_rangeselection.png
ico_rangeselected.png
+ ico_note.png
ButtonsBar.qml
ico_filter.png