diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-10 02:31:47 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-10 02:31:47 (GMT) |
commit | 602ae163b2736c204e113b3cd01dfa8645237f66 (patch) | |
tree | 8aaeff10629ec7490b63998976f2ff0ae993e0f8 | |
parent | d3a4e92d3e71fbbcaf52707107a93684edc0e587 (diff) | |
parent | af1350249ea9de68e1c4b72ed1179948aa28ca19 (diff) | |
download | Qt-602ae163b2736c204e113b3cd01dfa8645237f66.zip Qt-602ae163b2736c204e113b3cd01dfa8645237f66.tar.gz Qt-602ae163b2736c204e113b3cd01dfa8645237f66.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-qml-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-qml-team:
Create property cache in case of Component{} root
4 files changed, 23 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index e642a67..abde4ad 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -622,6 +622,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, out->dumpInstructions(); if (compilerStatDump()) dumpStats(); + Q_ASSERT(out->rootPropertyCache); } else { reset(out); } @@ -1218,6 +1219,11 @@ void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj) id.setId.index = obj->idIndex; output->bytecode << id; } + + if (obj == unitRoot) { + output->rootPropertyCache = output->types[obj->type].createPropertyCache(engine); + output->rootPropertyCache->addref(); + } } bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj, diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml new file mode 100644 index 0000000..785a27d --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +Component { + Item { + } +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml new file mode 100644 index 0000000..361bcbc --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml @@ -0,0 +1,4 @@ +import QtQuick 1.0 + +NestedComponentRoot { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index d6e6a4a..7f186b3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -135,6 +135,7 @@ private slots: void reservedWords_data(); void reservedWords(); void inlineAssignmentsOverrideBindings(); + void nestedComponentRoots(); void basicRemote_data(); void basicRemote(); @@ -1425,6 +1426,12 @@ void tst_qdeclarativelanguage::inlineAssignmentsOverrideBindings() delete o; } +// QTBUG-19354 +void tst_qdeclarativelanguage::nestedComponentRoots() +{ + QDeclarativeComponent component(&engine, TEST_FILE("nestedComponentRoots.qml")); +} + // Import tests (QT-558) void tst_qdeclarativelanguage::importsBuiltin_data() { |