Commit 8f0cdd41 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner.MetaInfo: Don't put unkown objects in the superclass stack

parent 26137151
......@@ -128,6 +128,37 @@ private:
QList<PropertyInfo> m_properties;
};
class HasValueProcessor : public Interpreter::MemberProcessor
{
public:
HasValueProcessor(const Interpreter::Value *compareValue)
: MemberProcessor(),
m_compareValue(compareValue),
m_isInMembers(false)
{}
virtual bool processProperty(const QString &/*name*/, const Interpreter::Value *value)
{
if (value == m_compareValue) {
m_isInMembers = true;
return false;
}
return true;
}
bool hasValue() const
{
return m_isInMembers;
}
private:
const Interpreter::Value *m_compareValue;
bool m_isInMembers;
};
static inline bool isValueType(const QString &type)
{
QStringList objectValuesList;
......@@ -792,9 +823,12 @@ void NodeMetaInfoPrivate::setupPrototypes()
description.majorVersion = qmlValue->version().majorVersion();
if (!qmlValue->packageName().isEmpty())
description.className = qmlValue->packageName() + "/" + description.className;
}
HasValueProcessor hasValueProcessor(ov);
lookupContext()->context()->typeEnvironment(document())->processMembers(&hasValueProcessor);
if (hasValueProcessor.hasValue())
m_prototypes.append(description);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment