Fix semantic checks not being applied to the Qml root object.

By always setting the scope object, even if it is identical to the root
object.

Done-with: Erik Verbruggen
This commit is contained in:
Christian Kamm
2010-02-23 12:34:52 +01:00
parent f45b80060d
commit b1522ba5c8
2 changed files with 2 additions and 3 deletions

View File

@@ -771,7 +771,7 @@ void ScopeChain::update()
foreach (QmlComponentChain *parent, qmlComponentScope.instantiatingComponents)
parent->add(&_all);
if (qmlComponentScope.rootObject)
if (qmlComponentScope.rootObject && ! qmlScopeObjects.contains(qmlComponentScope.rootObject))
_all += qmlComponentScope.rootObject;
_all += qmlScopeObjects;
_all += qmlComponentScope.functionScopes;

View File

@@ -68,8 +68,7 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
const ObjectValue *scopeObject = _doc->bind()->findQmlObject(node);
if (scopeObject) {
if (scopeObject != scopeChain.qmlComponentScope.rootObject)
scopeChain.qmlScopeObjects += scopeObject;
scopeChain.qmlScopeObjects += scopeObject;
}
#ifndef NO_DECLARATIVE_BACKEND