aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qml/creation/tst_creation.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp
index 2c8aa04a6a..fa94fd4d46 100644
--- a/tests/benchmarks/qml/creation/tst_creation.cpp
+++ b/tests/benchmarks/qml/creation/tst_creation.cpp
@@ -74,6 +74,9 @@ private slots:
void bindings_parent_qml();
+ void anchors_creation();
+ void anchors_heightChange();
+
private:
QQmlEngine engine;
};
@@ -462,6 +465,38 @@ void tst_creation::bindings_parent_qml()
delete obj;
}
+void tst_creation::anchors_creation()
+{
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick 2.0\nItem { Item { anchors.bottom: parent.bottom } }", QUrl());
+
+ QObject *obj = component.create();
+ delete obj;
+
+ QBENCHMARK {
+ QObject *obj = component.create();
+ delete obj;
+ }
+}
+
+void tst_creation::anchors_heightChange()
+{
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick 2.0\nItem { Item { anchors.bottom: parent.bottom } }", QUrl());
+
+ QObject *obj = component.create();
+ auto item = qobject_cast<QQuickItem *>(obj);
+ Q_ASSERT(item);
+ int height = 1;
+
+ QBENCHMARK {
+ item->setHeight(height);
+ height += 1;
+ }
+
+ delete obj;
+}
+
QTEST_MAIN(tst_creation)
#include "tst_creation.moc"