Qt 4.8
|
The QDeclarativeDomObject class represents an object instantiation. More...
#include <qdeclarativedom_p.h>
Public Functions | |
QByteArray | customTypeData () const |
If this object represents a custom type, returns the data associated with the custom type, otherwise returns an empty QByteArray(). More... | |
QList< QDeclarativeDomDynamicProperty > | dynamicProperties () const |
QDeclarativeDomDynamicProperty | dynamicProperty (const QByteArray &) const |
bool | isComponent () const |
Returns true if this object is a sub-component object. More... | |
bool | isCustomType () const |
Returns true if this object is a custom type. More... | |
bool | isValid () const |
Returns true if this is a valid QDeclarativeDomObject, false otherwise. More... | |
int | length () const |
Returns the length in the input data from where the property assignment star ted upto the end of it, or -1 if the property is invalid. More... | |
QByteArray | objectClassName () const |
Returns the type name as referenced in the qml file. More... | |
QString | objectId () const |
Returns the QML id assigned to this object, or an empty QByteArray if no id has been assigned. More... | |
QByteArray | objectType () const |
Returns the fully-qualified type name of this object. More... | |
int | objectTypeMajorVersion () const |
int | objectTypeMinorVersion () const |
QDeclarativeDomObject & | operator= (const QDeclarativeDomObject &) |
Assign other to this QDeclarativeDomObject. More... | |
int | position () const |
Returns the position in the input data where the property assignment started , or -1 if the property is invalid. More... | |
QList< QDeclarativeDomProperty > | properties () const |
Returns the list of assigned properties on this object. More... | |
QDeclarativeDomProperty | property (const QByteArray &) const |
Returns the object's name property if a value has been assigned to it, or an invalid QDeclarativeDomProperty otherwise. More... | |
QDeclarativeDomObject () | |
Construct an invalid QDeclarativeDomObject. More... | |
QDeclarativeDomObject (const QDeclarativeDomObject &) | |
Create a copy of other QDeclarativeDomObject. More... | |
QDeclarativeDomComponent | toComponent () const |
Returns a QDeclarativeDomComponent for this object if it is a sub-component, or an invalid QDeclarativeDomComponent if not. More... | |
QUrl | url () const |
~QDeclarativeDomObject () | |
Destroy the QDeclarativeDomObject. More... | |
Properties | |
QSharedDataPointer< QDeclarativeDomObjectPrivate > | d |
Friends | |
class | QDeclarativeDomComponent |
class | QDeclarativeDomDocument |
class | QDeclarativeDomValue |
class | QDeclarativeDomValueValueInterceptor |
class | QDeclarativeDomValueValueSource |
The QDeclarativeDomObject class represents an object instantiation.
Each object instantiated in a QML file has a corresponding QDeclarativeDomObject node in the QML DOM. In addition to the type information that determines the object to instantiate, QDeclarativeDomObject's also have a set of associated QDeclarativeDomProperty's. Each QDeclarativeDomProperty represents a QML property assignment on the instantiated object. For example,
describes a single QDeclarativeDomObject - "QGraphicsWidget" - with two properties, "opacity" and "size". Obviously QGraphicsWidget has many more properties than just these two, but the QML DOM representation only contains those assigned values (or bindings) in the QML file.
Definition at line 156 of file qdeclarativedom_p.h.
QDeclarativeDomObject::QDeclarativeDomObject | ( | ) |
Construct an invalid QDeclarativeDomObject.
Definition at line 674 of file qdeclarativedom.cpp.
QDeclarativeDomObject::QDeclarativeDomObject | ( | const QDeclarativeDomObject & | other | ) |
Create a copy of other QDeclarativeDomObject.
Definition at line 682 of file qdeclarativedom.cpp.
QDeclarativeDomObject::~QDeclarativeDomObject | ( | ) |
QByteArray QDeclarativeDomObject::customTypeData | ( | ) | const |
If this object represents a custom type, returns the data associated with the custom type, otherwise returns an empty QByteArray().
QDeclarativeDomObject::isCustomType() can be used to check if this object represents a custom type.
Definition at line 894 of file qdeclarativedom.cpp.
QList< QDeclarativeDomDynamicProperty > QDeclarativeDomObject::dynamicProperties | ( | ) | const |
Definition at line 835 of file qdeclarativedom.cpp.
QDeclarativeDomDynamicProperty QDeclarativeDomObject::dynamicProperty | ( | const QByteArray & | name | ) | const |
Definition at line 854 of file qdeclarativedom.cpp.
bool QDeclarativeDomObject::isComponent | ( | ) | const |
Returns true if this object is a sub-component object.
Sub-component objects can be converted into QDeclarativeDomComponent instances by calling QDeclarativeDomObject::toComponent().
Definition at line 906 of file qdeclarativedom.cpp.
Referenced by properties(), and toComponent().
bool QDeclarativeDomObject::isCustomType | ( | ) | const |
Returns true if this object is a custom type.
Custom types are special types that allow embeddeding non-QML data, such as SVG or HTML data, directly into QML files.
Definition at line 883 of file qdeclarativedom.cpp.
bool QDeclarativeDomObject::isValid | ( | ) | const |
Returns true if this is a valid QDeclarativeDomObject, false otherwise.
Definition at line 706 of file qdeclarativedom.cpp.
Referenced by dynamicProperty().
int QDeclarativeDomObject::length | ( | ) | const |
Returns the length in the input data from where the property assignment star
ted upto the end of it, or -1 if the property is invalid.
Definition at line 942 of file qdeclarativedom.cpp.
QByteArray QDeclarativeDomObject::objectClassName | ( | ) | const |
Returns the type name as referenced in the qml file.
For example, the type of this object would be "Rectangle".
Definition at line 733 of file qdeclarativedom.cpp.
QString QDeclarativeDomObject::objectId | ( | ) | const |
Returns the QML id assigned to this object, or an empty QByteArray if no id has been assigned.
For example, the object id of this object would be "MyText".
Definition at line 766 of file qdeclarativedom.cpp.
QByteArray QDeclarativeDomObject::objectType | ( | ) | const |
Returns the fully-qualified type name of this object.
For example, the type of this object would be "Qt/4.6/Rectangle".
Definition at line 719 of file qdeclarativedom.cpp.
int QDeclarativeDomObject::objectTypeMajorVersion | ( | ) | const |
Definition at line 741 of file qdeclarativedom.cpp.
int QDeclarativeDomObject::objectTypeMinorVersion | ( | ) | const |
Definition at line 749 of file qdeclarativedom.cpp.
QDeclarativeDomObject & QDeclarativeDomObject::operator= | ( | const QDeclarativeDomObject & | other | ) |
Assign other to this QDeclarativeDomObject.
Definition at line 697 of file qdeclarativedom.cpp.
int QDeclarativeDomObject::position | ( | ) | const |
Returns the position in the input data where the property assignment started
, or -1 if the property is invalid.
Definition at line 930 of file qdeclarativedom.cpp.
QList< QDeclarativeDomProperty > QDeclarativeDomObject::properties | ( | ) | const |
Returns the list of assigned properties on this object.
In the following example, "text" and "x" properties would be returned.
Definition at line 786 of file qdeclarativedom.cpp.
Referenced by dynamicProperties(), and property().
QDeclarativeDomProperty QDeclarativeDomObject::property | ( | const QByteArray & | name | ) | const |
Returns the object's name property if a value has been assigned to it, or an invalid QDeclarativeDomProperty otherwise.
In the example below, {object.property
("source")} would return a valid QDeclarativeDomProperty, and {object.property
("tile")} an invalid QDeclarativeDomProperty.
Definition at line 826 of file qdeclarativedom.cpp.
QDeclarativeDomComponent QDeclarativeDomObject::toComponent | ( | ) | const |
Returns a QDeclarativeDomComponent for this object if it is a sub-component, or an invalid QDeclarativeDomComponent if not.
QDeclarativeDomObject::isComponent() can be used to check if this object represents a sub-component.
Definition at line 918 of file qdeclarativedom.cpp.
QUrl QDeclarativeDomObject::url | ( | ) | const |
Definition at line 952 of file qdeclarativedom.cpp.
|
friend |
Definition at line 192 of file qdeclarativedom_p.h.
|
friend |
Definition at line 191 of file qdeclarativedom_p.h.
|
friend |
Definition at line 193 of file qdeclarativedom_p.h.
|
friend |
Definition at line 195 of file qdeclarativedom_p.h.
|
friend |
Definition at line 194 of file qdeclarativedom_p.h.
|
private |
Definition at line 196 of file qdeclarativedom_p.h.
Referenced by QDeclarativeDomComponent::componentRoot(), dynamicProperties(), dynamicProperty(), isComponent(), isValid(), length(), QDeclarativeDomValueValueSource::object(), QDeclarativeDomValueValueInterceptor::object(), objectClassName(), objectId(), objectType(), objectTypeMajorVersion(), objectTypeMinorVersion(), operator=(), position(), properties(), QDeclarativeDomDocument::rootObject(), toComponent(), QDeclarativeDomValue::toObject(), and url().