diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-12-21 12:29:21 (GMT) |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-12-21 12:29:21 (GMT) |
commit | 0098aae60dfccc11c25ef412049708f69bd94e6c (patch) | |
tree | 75888646a7829c8ae5b883f409d0afb3e08c9cf5 /src/declarative | |
parent | 5861eec545692ad1b6df00dde28ad044cfe1477b (diff) | |
download | Qt-0098aae60dfccc11c25ef412049708f69bd94e6c.zip Qt-0098aae60dfccc11c25ef412049708f69bd94e6c.tar.gz Qt-0098aae60dfccc11c25ef412049708f69bd94e6c.tar.bz2 |
Added isAlias to the QmlDomDynamicProperty.
Diffstat (limited to 'src/declarative')
-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; |