diff options
-rw-r--r-- | src/declarative/qml/qmldom.cpp | 17 | ||||
-rw-r--r-- | src/declarative/qml/qmldom.h | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 705c0cf..e46ea96 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -462,6 +462,11 @@ QByteArray QmlDomDynamicProperty::propertyName() const return QByteArray(); } +/*! + Returns the type of the dynamic property. Note that when the property is an + alias property, this will return -1. Use QmlDomProperty::isAlias() to check + if the property is an alias. +*/ int QmlDomDynamicProperty::propertyType() const { if (isValid()) { @@ -546,6 +551,18 @@ QmlDomProperty QmlDomDynamicProperty::defaultValue() const } /*! + Returns true if this dynamic property is an alias for another property, + false otherwise. +*/ +bool QmlDomDynamicProperty::isAlias() const +{ + if (isValid()) + return d->property.type == QmlParser::Object::DynamicProperty::Alias; + else + return false; +} + +/*! Returns the position in the input data where the property ID startd, or 0 if the property is invalid. */ diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h index 24710f1..8442f49 100644 --- a/src/declarative/qml/qmldom.h +++ b/src/declarative/qml/qmldom.h @@ -127,9 +127,10 @@ public: QByteArray propertyTypeName() const; bool isDefaultProperty() const; - QmlDomProperty defaultValue() const; + bool isAlias() const; + int position() const; int length() const; |