diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-31 09:58:13 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-31 12:03:57 +0200 |
commit | 790268130926f318c007b41439c9d60463666e34 (patch) | |
tree | ad182dcf6fd0eaed4e48b32d1ade176f12a33bf7 /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | |
parent | bd54c80e4b60f922bf29154e8c1131c274a603a8 (diff) |
Fix performance regression of parent setting during QML object creation
This showed up in the profiles again: In QML we create a lot of objects
with many children and sending a child event each time is expensive. That's
why the VME didn't do that and hadn't done so in ages. This patch restores
that behavior and aspect of loading performance.
Change-Id: I5078fe330d913dc832b284aaecf031152dc80802
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 619c7719f6..ede499b336 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -236,6 +236,8 @@ private slots: void rootObjectInCreationNotForSubObjects(); + void noChildEvents(); + private: QQmlEngine engine; QStringList defaultImportPathList; @@ -3677,6 +3679,16 @@ void tst_qqmllanguage::rootObjectInCreationNotForSubObjects() QVERIFY(!ddata->rootObjectInCreation); } +void tst_qqmllanguage::noChildEvents() +{ + QQmlComponent component(&engine); + component.setData("import QtQml 2.0; import Test 1.0; MyQmlObject { property QtObject child: QtObject {} }", QUrl()); + VERIFY_ERRORS(0); + MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create()); + QVERIFY(object != 0); + QCOMPARE(object->childAddedEventCount(), 0); +} + QTEST_MAIN(tst_qqmllanguage) #include "tst_qqmllanguage.moc" |