Fix completion and checking for Script elements. Update Qml type xml.

* The "Script" type is now implicitly available without imports.
* No errors for bindings inside a Connections element.

Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-03-03 11:36:42 +01:00
parent 93dbb3a5fc
commit 08b9323f0c
5 changed files with 1493 additions and 1339 deletions

View File

@@ -73,12 +73,14 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
return; // Probably syntax errors, where we're working with a "recovered" AST.
}
// check if the object has a Qt.ListElement ancestor
// check if the object has a Qt.ListElement or Qt.Connections ancestor
// ### allow only signal bindings for Connections
const ObjectValue *prototype = scopeObject->prototype(_context);
while (prototype) {
if (const QmlObjectValue *qmlMetaObject = dynamic_cast<const QmlObjectValue *>(prototype)) {
if (qmlMetaObject->className() == QLatin1String("ListElement")
&& qmlMetaObject->packageName() == QLatin1String("Qt")) {
if ((qmlMetaObject->className() == QLatin1String("ListElement")
|| qmlMetaObject->className() == QLatin1String("Connections")
) && qmlMetaObject->packageName() == QLatin1String("Qt")) {
scopeChain.qmlScopeObjects.clear();
break;
}