Qt 4.8
|
The QDeclarativeDomDocument class represents the root of a QML document. More...
#include <qdeclarativedom_p.h>
Public Functions | |
QList< QDeclarativeError > | errors () const |
Returns the last load errors. More... | |
QList< QDeclarativeDomImport > | imports () const |
Returns all import statements in qml. More... | |
bool | load (QDeclarativeEngine *, const QByteArray &, const QUrl &=QUrl()) |
Loads a QDeclarativeDomDocument from data. More... | |
QDeclarativeDomDocument & | operator= (const QDeclarativeDomDocument &) |
Assign other to this QDeclarativeDomDocument. More... | |
QDeclarativeDomDocument () | |
Construct an empty QDeclarativeDomDocument. More... | |
QDeclarativeDomDocument (const QDeclarativeDomDocument &) | |
Create a copy of other QDeclarativeDomDocument. More... | |
QDeclarativeDomObject | rootObject () const |
Returns the document's root object, or an invalid QDeclarativeDomObject if the document has no root. More... | |
~QDeclarativeDomDocument () | |
Destroy the QDeclarativeDomDocument. More... | |
Properties | |
QSharedDataPointer< QDeclarativeDomDocumentPrivate > | d |
The QDeclarativeDomDocument class represents the root of a QML document.
A QML document is a self-contained snippet of QML, usually contained in a single file. Each document has a root object, accessible through QDeclarativeDomDocument::rootObject().
The QDeclarativeDomDocument class allows the programmer to inspect a QML document by calling QDeclarativeDomDocument::load().
The following example loads a QML file from disk, and prints out its root object type and the properties assigned in the root object.
Definition at line 81 of file qdeclarativedom_p.h.
QDeclarativeDomDocument::QDeclarativeDomDocument | ( | ) |
Construct an empty QDeclarativeDomDocument.
Definition at line 101 of file qdeclarativedom.cpp.
QDeclarativeDomDocument::QDeclarativeDomDocument | ( | const QDeclarativeDomDocument & | other | ) |
Create a copy of other QDeclarativeDomDocument.
Definition at line 109 of file qdeclarativedom.cpp.
QDeclarativeDomDocument::~QDeclarativeDomDocument | ( | ) |
Destroy the QDeclarativeDomDocument.
Definition at line 117 of file qdeclarativedom.cpp.
QList< QDeclarativeError > QDeclarativeDomDocument::errors | ( | ) | const |
Returns the last load errors.
The load errors will be reset after a successful call to load().
Definition at line 190 of file qdeclarativedom.cpp.
QList< QDeclarativeDomImport > QDeclarativeDomDocument::imports | ( | ) | const |
Returns all import statements in qml.
Definition at line 133 of file qdeclarativedom.cpp.
bool QDeclarativeDomDocument::load | ( | QDeclarativeEngine * | engine, |
const QByteArray & | data, | ||
const QUrl & | url = QUrl() |
||
) |
Loads a QDeclarativeDomDocument from data.
data should be valid QML data. On success, true is returned. If the data is malformed, false is returned and QDeclarativeDomDocument::errors() contains an error description.
Definition at line 145 of file qdeclarativedom.cpp.
QDeclarativeDomDocument & QDeclarativeDomDocument::operator= | ( | const QDeclarativeDomDocument & | other | ) |
Assign other to this QDeclarativeDomDocument.
Definition at line 124 of file qdeclarativedom.cpp.
QDeclarativeDomObject QDeclarativeDomDocument::rootObject | ( | ) | const |
Returns the document's root object, or an invalid QDeclarativeDomObject if the document has no root.
In the sample QML below, the root object will be the QDeclarativeItem type.
Definition at line 208 of file qdeclarativedom.cpp.
|
private |
Definition at line 97 of file qdeclarativedom_p.h.
Referenced by errors(), imports(), load(), operator=(), and rootObject().