Qt 4.8
|
The QDeclarativeDomProperty class represents one property assignment in the QML DOM tree. More...
#include <qdeclarativedom_p.h>
Public Functions | |
bool | isDefaultProperty () const |
Return true if this property is used as a default property in the QML document. More... | |
bool | isValid () const |
Returns true if this is a valid QDeclarativeDomProperty, false otherwise. More... | |
int | length () const |
Returns the length in the input data from where the property ID started upto the end of it, or -1 if the property is invalid. More... | |
QDeclarativeDomProperty & | operator= (const QDeclarativeDomProperty &) |
Assign other to this QDeclarativeDomProperty. More... | |
int | position () const |
Returns the position in the input data where the property ID startd, or -1 if the property is invalid. More... | |
QByteArray | propertyName () const |
Return the name of this property. More... | |
QList< QByteArray > | propertyNameParts () const |
Return the name of this property, split into multiple parts in the case of dot properties. More... | |
QDeclarativeDomProperty () | |
Construct an invalid QDeclarativeDomProperty. More... | |
QDeclarativeDomProperty (const QDeclarativeDomProperty &) | |
Create a copy of other QDeclarativeDomProperty. More... | |
QDeclarativeDomValue | value () const |
Returns the QDeclarativeDomValue that is assigned to this property, or an invalid QDeclarativeDomValue if no value is assigned. More... | |
~QDeclarativeDomProperty () | |
Destroy the QDeclarativeDomProperty. More... | |
Properties | |
QSharedDataPointer< QDeclarativeDomPropertyPrivate > | d |
Friends | |
class | QDeclarativeDomDynamicProperty |
class | QDeclarativeDomObject |
The QDeclarativeDomProperty class represents one property assignment in the QML DOM tree.
Properties in QML can be assigned QML QDeclarativeDomValue{values}.
Definition at line 101 of file qdeclarativedom_p.h.
QDeclarativeDomProperty::QDeclarativeDomProperty | ( | ) |
Construct an invalid QDeclarativeDomProperty.
Definition at line 253 of file qdeclarativedom.cpp.
QDeclarativeDomProperty::QDeclarativeDomProperty | ( | const QDeclarativeDomProperty & | other | ) |
Create a copy of other QDeclarativeDomProperty.
Definition at line 261 of file qdeclarativedom.cpp.
QDeclarativeDomProperty::~QDeclarativeDomProperty | ( | ) |
Destroy the QDeclarativeDomProperty.
Definition at line 269 of file qdeclarativedom.cpp.
bool QDeclarativeDomProperty::isDefaultProperty | ( | ) | const |
Return true if this property is used as a default property in the QML document.
The above two examples return the same DOM tree, except that the second has the default property flag set on the text property. Observe that whether or not a property has isDefaultProperty set is determined by how the property is used, and not only by whether the property is the types default property.
Definition at line 354 of file qdeclarativedom.cpp.
bool QDeclarativeDomProperty::isValid | ( | ) | const |
Returns true if this is a valid QDeclarativeDomProperty, false otherwise.
Definition at line 285 of file qdeclarativedom.cpp.
int QDeclarativeDomProperty::length | ( | ) | const |
Returns the length in the input data from where the property ID started upto the end of it, or -1 if the property is invalid.
Definition at line 394 of file qdeclarativedom.cpp.
QDeclarativeDomProperty & QDeclarativeDomProperty::operator= | ( | const QDeclarativeDomProperty & | other | ) |
Assign other to this QDeclarativeDomProperty.
Definition at line 276 of file qdeclarativedom.cpp.
int QDeclarativeDomProperty::position | ( | ) | const |
Returns the position in the input data where the property ID startd, or -1 if the property is invalid.
Definition at line 382 of file qdeclarativedom.cpp.
QByteArray QDeclarativeDomProperty::propertyName | ( | ) | const |
Return the name of this property.
As illustrated above, a property name can be a simple string, such as "x" or "y", or a more complex "dot property", such as "font.bold". In both cases the full name is returned ("x", "y" and "font.bold") by this method.
For dot properties, a split version of the name can be accessed by calling QDeclarativeDomProperty::propertyNameParts().
Definition at line 311 of file qdeclarativedom.cpp.
Referenced by QDeclarativeDomObject::property().
QList< QByteArray > QDeclarativeDomProperty::propertyNameParts | ( | ) | const |
Return the name of this property, split into multiple parts in the case of dot properties.
For each of the properties shown above, this method would return ("x"), ("y") and ("font", "bold").
Definition at line 333 of file qdeclarativedom.cpp.
QDeclarativeDomValue QDeclarativeDomProperty::value | ( | ) | const |
Returns the QDeclarativeDomValue that is assigned to this property, or an invalid QDeclarativeDomValue if no value is assigned.
Definition at line 363 of file qdeclarativedom.cpp.
|
friend |
Definition at line 123 of file qdeclarativedom_p.h.
|
friend |
Definition at line 122 of file qdeclarativedom_p.h.
|
private |
Definition at line 124 of file qdeclarativedom_p.h.
Referenced by QDeclarativeDomDynamicProperty::defaultValue(), isDefaultProperty(), isValid(), length(), operator=(), position(), QDeclarativeDomObject::properties(), propertyName(), propertyNameParts(), and value().