aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qml/deltablue/Plan.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/qml/deltablue/Plan.qml')
-rw-r--r--tests/benchmarks/qml/deltablue/Plan.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/benchmarks/qml/deltablue/Plan.qml b/tests/benchmarks/qml/deltablue/Plan.qml
new file mode 100644
index 0000000000..4e3bd7c8a6
--- /dev/null
+++ b/tests/benchmarks/qml/deltablue/Plan.qml
@@ -0,0 +1,27 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+pragma Strict
+import QtQml
+
+QtObject {
+ property list<Constraint> v
+
+ function clear() {
+ v.length = 0;
+ }
+
+ function addConstraint(c: Constraint) {
+ let constraints = v;
+ constraints[constraints.length++] = c;
+ }
+
+ function execute() {
+ let constraints = v;
+ for (let i = 0, length = constraints.length; i < length; ++i) {
+ let c = constraints[i];
+ if (c.input)
+ c.output.value = c.evaluate();
+ }
+ }
+}