QmlObjectValue: bugifx for QmlObjectValue::propertyType()

We have to follow the prototype chain

Reviewed-by: Christian Kamm
This commit is contained in:
Thomas Hartmann
2010-11-10 16:38:41 +01:00
committed by Christian Kamm
parent d63199ca13
commit bb9a9d060f

View File

@@ -931,21 +931,23 @@ QString QmlObjectValue::defaultPropertyName() const
QString QmlObjectValue::propertyType(const QString &propertyName) const
{
for (const FakeMetaObject *iter = _metaObject; iter; iter = iter->superClass()) {
int propIdx = _metaObject->propertyIndex(propertyName);
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
return _metaObject->property(propIdx).typeName();
return iter->property(propIdx).typeName();
}
}
return QString();
}
bool QmlObjectValue::isListProperty(const QString &name) const
bool QmlObjectValue::isListProperty(const QString &propertyName) const
{
int idx = _metaObject->propertyIndex(name);
if (idx == -1)
return false;
FakeMetaProperty prop = _metaObject->property(idx);
return prop.isList();
for (const FakeMetaObject *iter = _metaObject; iter; iter = iter->superClass()) {
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
return iter->property(propIdx).isList();
}
}
return false;
}
bool QmlObjectValue::isEnum(const QString &typeName) const