aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/changes/changing_textcanvas.qml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/auto/changes/changing_textcanvas.qml')
-rw-r--r--benchmarks/auto/changes/changing_textcanvas.qml34
1 files changed, 34 insertions, 0 deletions
diff --git a/benchmarks/auto/changes/changing_textcanvas.qml b/benchmarks/auto/changes/changing_textcanvas.qml
new file mode 100644
index 0000000..58094e1
--- /dev/null
+++ b/benchmarks/auto/changes/changing_textcanvas.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+
+Item {
+ id: root;
+ property int count: 100;
+ property int staticCount: 1000;
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1; duration: 2347; loops: Animation.Infinite }
+
+ Repeater {
+ id: repeater
+ model: root.count
+ Canvas {
+
+ x: Math.floor( Math.random() * root.width )
+ y: Math.floor( Math.random() * root.height )
+
+ width: 40
+ height: 15
+
+ property real t: root.t;
+ onTChanged: requestPaint();
+
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.clearRect(0, 0, width, height);
+ ctx.fillText("" + Math.floor( t * 1000 ) / 1000, 0, 10);
+ }
+
+ }
+
+ }
+}