Skip to content
Snippets Groups Projects
Commit ce092d3f authored by Ulf Hermann's avatar Ulf Hermann
Browse files

Timeline: avoid rebuilding of text nodes


Using an array of strings as model has the unfortunate effect that all
text nodes resulting from it are rebuilt whenever anything in the
array changes. Using a number as model only triggers a rebuild of
everything when the number changes.

Change-Id: I8a762e78eb75b282f46641a6cba6eff43c8ebfd5
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent e8e45ca1
No related branches found
No related tags found
No related merge requests found
......@@ -144,17 +144,20 @@ Item {
columns: 2
Repeater {
model: [
id: details
property var contents: [
qsTr("Start") + ":",
detailedPrintTime(startTime),
showDuration ? (qsTr("End") + ":") : "",
showDuration ? detailedPrintTime(endTime) : "",
showDuration ? (qsTr("Duration") + ":") : "",
showDuration ? detailedPrintTime(duration) : ""
(qsTr("End") + ":"),
detailedPrintTime(endTime),
(qsTr("Duration") + ":"),
detailedPrintTime(duration)
]
model: showDuration ? 6 : 2
Detail {
isLabel: index % 2 === 0
text: modelData
text: details.contents[index]
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment