aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2016-11-03 08:56:13 +0100
committerGitHub <noreply@github.com>2016-11-03 08:56:13 +0100
commit2b07c9e04c9e97069e6c14860193c0ca80b8de65 (patch)
tree61debbd3ec0c7a1034cea8fa28d45c8c6bc62ac4
parent405997d2646579ddacd5322b77d1e6197f6a3c9c (diff)
parent6b45c12a25d13e59dcbc3bfb01661bb9e92901b7 (diff)
Merge pull request #1 from mpchst/controls2
Add Qt Quick Controls 2 variants for comparison
-rw-r--r--benchmark/creation/delegates_buttoncontrol2.qml25
-rw-r--r--benchmark/creation/delegates_labelcontrol2.qml25
2 files changed, 50 insertions, 0 deletions
diff --git a/benchmark/creation/delegates_buttoncontrol2.qml b/benchmark/creation/delegates_buttoncontrol2.qml
new file mode 100644
index 0000000..660795e
--- /dev/null
+++ b/benchmark/creation/delegates_buttoncontrol2.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+import QtQuick.Controls 2.0
+
+Item {
+ id: root;
+ property int count: 20;
+
+ 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
+ Button {
+ x: Math.random() * root.width - width
+ y: Math.random() * root.height - height
+ text: "Item #" + index;
+ }
+ }
+}
diff --git a/benchmark/creation/delegates_labelcontrol2.qml b/benchmark/creation/delegates_labelcontrol2.qml
new file mode 100644
index 0000000..7549921
--- /dev/null
+++ b/benchmark/creation/delegates_labelcontrol2.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+import QtQuick.Controls 2.0
+
+Item {
+ id: root;
+ property int count: 20;
+
+ 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
+ Label {
+ x: Math.random() * root.width - width
+ y: Math.random() * root.height - height
+ text: "Qt Quick!"
+ }
+ }
+}