diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-24 11:08:09 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-24 11:33:42 +0200 |
commit | 9ff09fb283cd130fb717769b44f54bfbb28efd8a (patch) | |
tree | 711f70b4b494bd996d54bdab5c44f3c89b37a6d1 /tests/benchmarks | |
parent | 592b5b49b6c0043fae5db7721689813ebd226032 (diff) | |
parent | ec2b2a5f5d804095b6b2b8575b1cd1b75a8335ff (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Conflicts:
src/quick/items/qquickopenglshadereffectnode.cpp
src/quick/items/qquickshadereffect.cpp
src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
src/quick/scenegraph/qsgdefaultglyphnode_p.h
Change-Id: I3d6874b4e4231a89d2836c04fe8e7f2ef2d698c4
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/qml/creation/tst_creation.cpp | 35 |
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" |