aboutsummaryrefslogtreecommitdiffstats
path: root/src/benchmarks/auto/animations/comparison/moving-images-script.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmarks/auto/animations/comparison/moving-images-script.qml')
-rw-r--r--src/benchmarks/auto/animations/comparison/moving-images-script.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/benchmarks/auto/animations/comparison/moving-images-script.qml b/src/benchmarks/auto/animations/comparison/moving-images-script.qml
new file mode 100644
index 0000000..54f0c0c
--- /dev/null
+++ b/src/benchmarks/auto/animations/comparison/moving-images-script.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.2
+import QmlBench 1.0
+
+// Move images around using a property binding, to be compared with a number of
+// other similar ways to move them around.
+Benchmark {
+ id: root;
+
+ count: 500
+ staticCount: 20000
+
+ Repeater {
+ model: root.count
+ Image {
+ source: "qrc:///shared/butterfly-wide.png"
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 40
+ height: 40
+
+ property real t;
+ rotation: 10 * Math.sin(t * Math.PI * 2 + Math.PI);
+
+ SequentialAnimation on t {
+ NumberAnimation { from: 0; to: 1; duration: 1000; }
+ loops: Animation.Infinite
+ }
+ }
+ }
+}