From 0098aae60dfccc11c25ef412049708f69bd94e6c Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 21 Dec 2009 13:29:21 +0100 Subject: Added isAlias to the QmlDomDynamicProperty. --- src/declarative/qml/qmldom.cpp | 17 +++++++++++++++++ src/declarative/qml/qmldom.h | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) 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; -- cgit v0.12