diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index 9c290630baf..e068a4f4ffa 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -84,7 +84,7 @@ using namespace QmlJS; typedef QPair PropertyInfo; -QList getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false); +QList getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false, int rec = 0); static TypeName resolveTypeName(const ASTPropertyReference *ref, const ContextPtr &context, QList &dotProperties) { @@ -226,7 +226,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve return list; } -QList getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false) +QList getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false, int rec = 0) { QList propertyList; @@ -235,6 +235,9 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont if (objectValue->className().isEmpty()) return propertyList; + if (rec > 2) + return propertyList; + PropertyMemberProcessor processor(context); objectValue->processMembers(&processor); @@ -246,7 +249,7 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont //dot property const CppComponentValue * qmlValue = value_cast(objectValue->lookupMember(name, context)); if (qmlValue) { - QList dotProperties = getQmlTypes(qmlValue, context); + QList dotProperties = getQmlTypes(qmlValue, context, false, rec + 1); foreach (const PropertyInfo &propertyInfo, dotProperties) { PropertyName dotName = propertyInfo.first; TypeName type = propertyInfo.second; @@ -258,7 +261,7 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont if (isValueType(objectValue->propertyType(name))) { const ObjectValue *dotObjectValue = value_cast(objectValue->lookupMember(name, context)); if (dotObjectValue) { - QList dotProperties = getObjectTypes(dotObjectValue, context); + QList dotProperties = getObjectTypes(dotObjectValue, context, false, rec + 1); foreach (const PropertyInfo &propertyInfo, dotProperties) { PropertyName dotName = propertyInfo.first; TypeName type = propertyInfo.second; @@ -279,9 +282,9 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont const CppComponentValue * qmlObjectValue = value_cast(prototype); if (qmlObjectValue) - propertyList.append(getQmlTypes(qmlObjectValue, context)); + propertyList.append(getQmlTypes(qmlObjectValue, context, false, rec + 1)); else - propertyList.append(getObjectTypes(prototype, context)); + propertyList.append(getObjectTypes(prototype, context, false, rec + 1)); } return propertyList; @@ -327,7 +330,7 @@ QList getTypes(const ObjectValue *objectValue, const ContextPtr &c return propertyList; } -QList getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local) +QList getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local, int rec) { QList propertyList; @@ -336,6 +339,9 @@ QList getObjectTypes(const ObjectValue *objectValue, const Context if (objectValue->className().isEmpty()) return propertyList; + if (rec > 2) + return propertyList; + PropertyMemberProcessor processor(context); objectValue->processMembers(&processor); @@ -350,9 +356,9 @@ QList getObjectTypes(const ObjectValue *objectValue, const Context const CppComponentValue * qmlObjectValue = value_cast(prototype); if (qmlObjectValue) - propertyList.append(getQmlTypes(qmlObjectValue, context)); + propertyList.append(getQmlTypes(qmlObjectValue, context, local, rec + 1)); else - propertyList.append(getObjectTypes(prototype, context)); + propertyList.append(getObjectTypes(prototype, context, local, rec + 1)); } return propertyList;