aboutsummaryrefslogtreecommitdiffstats
path: root/src/benchmarks/auto/changes/changing_text_oneofmany.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmarks/auto/changes/changing_text_oneofmany.qml')
-rw-r--r--src/benchmarks/auto/changes/changing_text_oneofmany.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/benchmarks/auto/changes/changing_text_oneofmany.qml b/src/benchmarks/auto/changes/changing_text_oneofmany.qml
new file mode 100644
index 0000000..879b99b
--- /dev/null
+++ b/src/benchmarks/auto/changes/changing_text_oneofmany.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of changing 1 Text in a scene vs all (changing_texts)
+Item {
+ id: root;
+ property int count: 100
+ property int staticCount: 1000;
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1000; duration: 1000; loops: Animation.Infinite }
+
+ Repeater {
+ id: repeater
+ model: root.count
+ Text {
+ x: QmlBench.getRandom() * root.width
+ y: QmlBench.getRandom() * root.height
+ text: index == 0 ? Math.round(t) : index;
+ }
+ }
+}