summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcompiler.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 04:15:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 04:15:08 (GMT)
commit24653fc546fe8150ebca1c44c36fe17c36527cc7 (patch)
treea5946ba6011396a543694de475537fe3abc2ced1 /src/declarative/qml/qmlcompiler.cpp
parent1ea93870fce7ff032053775fb19d42e950dd5ccb (diff)
downloadQt-24653fc546fe8150ebca1c44c36fe17c36527cc7.zip
Qt-24653fc546fe8150ebca1c44c36fe17c36527cc7.tar.gz
Qt-24653fc546fe8150ebca1c44c36fe17c36527cc7.tar.bz2
Test that Component {} is allowed as the root element
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 6d1df6d..023903d 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -672,7 +672,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
obj->className = tr.className;
// This object is a "Component" element
- if (obj->metatype == &QmlComponent::staticMetaObject) {
+ if (tr.type && obj->metatype == &QmlComponent::staticMetaObject) {
COMPILE_CHECK(buildComponent(obj, ctxt));
return true;
}
@@ -786,7 +786,9 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
void QmlCompiler::genObject(QmlParser::Object *obj)
{
- if (obj->metatype == &QmlComponent::staticMetaObject) {
+ const QmlCompiledData::TypeReference &tr =
+ output->types.at(obj->type);
+ if (tr.type && obj->metatype == &QmlComponent::staticMetaObject) {
genComponent(obj);
return;
}