From ce092d3f30cb489aa9546b8d5cc73759573c682c Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@theqtcompany.com>
Date: Mon, 31 Aug 2015 13:43:38 +0200
Subject: [PATCH] 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: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
---
 src/libs/timeline/qml/SelectionRangeDetails.qml | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/libs/timeline/qml/SelectionRangeDetails.qml b/src/libs/timeline/qml/SelectionRangeDetails.qml
index db142251ab7..0520c5e3988 100644
--- a/src/libs/timeline/qml/SelectionRangeDetails.qml
+++ b/src/libs/timeline/qml/SelectionRangeDetails.qml
@@ -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]
                 }
             }
         }
-- 
GitLab