forked from qt-creator/qt-creator
QmlJS: Fix bug in context property extraction.
Skip forward declarations instead of giving up. Change-Id: Id3a30296a7cefc4ef255d03727557dee6a37c362 Reviewed-on: http://codereview.qt-project.org/6321 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
@@ -659,10 +659,13 @@ static void buildContextProperties(
|
|||||||
typeScope = scope; // incorrect but may be an ok fallback
|
typeScope = scope; // incorrect but may be an ok fallback
|
||||||
ClassOrNamespace *binding = typeOf.context().lookupType(namedType->name(), typeScope);
|
ClassOrNamespace *binding = typeOf.context().lookupType(namedType->name(), typeScope);
|
||||||
if (binding && !binding->symbols().isEmpty()) {
|
if (binding && !binding->symbols().isEmpty()) {
|
||||||
Class *klass = binding->symbols().first()->asClass();
|
// find the best 'Class' symbol
|
||||||
if (klass) {
|
for (int i = binding->symbols().size() - 1; i >= 0; --i) {
|
||||||
|
if (Class *klass = binding->symbols().at(i)->asClass()) {
|
||||||
FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf);
|
FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf);
|
||||||
typeName = fmo->className();
|
typeName = fmo->className();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user