aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml
diff options
context:
space:
mode:
authorChris Adams <chris.adams@jollamobile.com>2013-04-17 11:27:17 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-01 23:58:02 +0200
commit4f50ab594aa2fb1d38981127beca634ad3396489 (patch)
tree91fa983bcf96b7277d7740ac25fc24137c7600fb /tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml
parent543023c43e347c76abbd4b6c25eea29e673c19dd (diff)
Add fine-grained QML / QtQuick performance benchmarks
This commit adds a series of benchmarks to test the performance of fundamental areas of the QML engine (compilation, instantiation, binding evaluation, positioning) using types provided by the QtQuick QML module. Change-Id: Iecec058c45aea0bd728f03123fa2aa79d6af8efa Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Diffstat (limited to 'tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml')
-rw-r--r--tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml76
1 files changed, 76 insertions, 0 deletions
diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml
new file mode 100644
index 0000000000..ef481ed55c
--- /dev/null
+++ b/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml
@@ -0,0 +1,76 @@
+import QtQuick 2.0
+
+// positioning via bindings with a grid
+Rectangle {
+ id: p
+ color: "red"
+ width: 400
+ height: 800
+
+ Rectangle {
+ id: c
+ color: "blue"
+ width: p.width
+ height: p.height / 2
+ y: p.height / 2
+
+ Grid {
+ id: g
+ rows: 2
+ columns: 2
+ width: c.width
+ height: c.height / 2
+ y: c.height / 2
+
+ Rectangle {
+ id: n1
+ color: "green"
+ width: g.width/2
+ height: g.height/2
+ }
+
+ Rectangle {
+ id: n2
+ color: "cyan"
+ width: g.width/2
+ height: g.height/2
+ }
+
+ Rectangle {
+ id: n3
+ color: "aquamarine"
+ width: g.width/2
+ height: g.height/2
+ }
+
+ Rectangle {
+ id: n4
+ color: "lightgreen"
+ width: g.width/2
+ height: g.height/2
+ }
+ }
+ }
+
+ // for visually determining correctness.
+ //Timer {
+ // property int count: 0
+ // interval: 1000
+ // running: true
+ // repeat: true
+ // onTriggered: {
+ // if (count == 0) {
+ // count = 1;
+ // p.height = 800;
+ // } else {
+ // count = 0;
+ // p.height = 400;
+ // }
+ // }
+ //}
+
+ Component.onCompleted: {
+ p.height = 800;
+ p.height = 400;
+ }
+}