aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/creation/quick/delegates_script.qml
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/auto/creation/quick/delegates_script.qml')
-rw-r--r--benchmarks/auto/creation/quick/delegates_script.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/benchmarks/auto/creation/quick/delegates_script.qml b/benchmarks/auto/creation/quick/delegates_script.qml
new file mode 100644
index 0000000..7e6c749
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_script.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+
+Item {
+ id: root;
+ property int count: 50;
+ property int staticCount: 2500;
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
+ onTChanged: {
+ repeater.model = 0;
+ repeater.model = root.count
+ }
+
+ Component.onCompleted: repeater.model = root.count
+
+ Repeater {
+ id: repeater
+ Rectangle {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ color: "steelblue"
+ Component.onCompleted: {
+ var t = Math.random();
+ color = Qt.hsla(t, 1, 0.5);
+ }
+ }
+ }
+}