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
|
||||
ClassOrNamespace *binding = typeOf.context().lookupType(namedType->name(), typeScope);
|
||||
if (binding && !binding->symbols().isEmpty()) {
|
||||
Class *klass = binding->symbols().first()->asClass();
|
||||
if (klass) {
|
||||
FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf);
|
||||
typeName = fmo->className();
|
||||
// find the best 'Class' symbol
|
||||
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);
|
||||
typeName = fmo->className();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user