forked from qt-creator/qt-creator
QmlJS: Provide good completion for PropertyChanges with a target again.
Task-number: QTCREATORBUG-1413 Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -106,14 +106,7 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
|
||||
|
||||
// check if the object has a Qt.PropertyChanges ancestor
|
||||
prototype = scopeObject->prototype(_context);
|
||||
while (prototype) {
|
||||
if (const QmlObjectValue *qmlMetaObject = dynamic_cast<const QmlObjectValue *>(prototype)) {
|
||||
if (qmlMetaObject->className() == QLatin1String("PropertyChanges")
|
||||
&& qmlMetaObject->packageName() == QLatin1String("Qt"))
|
||||
break;
|
||||
}
|
||||
prototype = prototype->prototype(_context);
|
||||
}
|
||||
prototype = isPropertyChangesObject(_context, prototype);
|
||||
// find the target script binding
|
||||
if (prototype) {
|
||||
UiObjectInitializer *initializer = 0;
|
||||
@@ -169,3 +162,19 @@ const Value *ScopeBuilder::scopeObjectLookup(AST::UiQualifiedId *id)
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
const ObjectValue *ScopeBuilder::isPropertyChangesObject(Context *context,
|
||||
const ObjectValue *object)
|
||||
{
|
||||
const ObjectValue *prototype = object;
|
||||
while (prototype) {
|
||||
if (const QmlObjectValue *qmlMetaObject = dynamic_cast<const QmlObjectValue *>(prototype)) {
|
||||
if (qmlMetaObject->className() == QLatin1String("PropertyChanges")
|
||||
&& qmlMetaObject->packageName() == QLatin1String("Qt"))
|
||||
return prototype;
|
||||
}
|
||||
prototype = prototype->prototype(context);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user