forked from qt-creator/qt-creator
QmlObjectValue: bugifx for QmlObjectValue::propertyType()
We have to follow the prototype chain Reviewed-by: Christian Kamm
This commit is contained in:
committed by
Christian Kamm
parent
d63199ca13
commit
bb9a9d060f
@@ -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
|
||||
|
Reference in New Issue
Block a user