diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-13 00:28:14 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-05-13 08:28:27 +0200 |
commit | ae745746a666134d9e9258b8c2ff00540624d835 (patch) | |
tree | 8294fffa3d752d61f79004fb04e21e927472fd8f /tests/benchmarks | |
parent | a7b383ab989e74ef552c2ef9c38377e065f1ab0e (diff) | |
parent | 531d00c1909527cb1bc28f17197267ccde408b0c (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/qml/jsapi/qjsengine.cpp
src/qml/qml/qqmlengine_p.h
src/quick/items/qquickanchors.cpp
src/quick/items/qquickanimatedimage_p_p.h
src/quick/items/qquickitem_p.h
tests/auto/qml/qqmlecmascript/testtypes.h
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tests/benchmarks/qml/creation/tst_creation.cpp
Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
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" |