summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/globalobject.qdoc
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-04-19 11:42:49 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-04-21 07:13:51 (GMT)
commit202af3021362d3c8066bc479a95e7aad889bd928 (patch)
tree03587443c77403321c18e384b3277abd576e9ba3 /doc/src/declarative/globalobject.qdoc
parent2ac290f56c6ad4f3e236034a7b99ecdb598ecc3a (diff)
downloadQt-202af3021362d3c8066bc479a95e7aad889bd928.zip
Qt-202af3021362d3c8066bc479a95e7aad889bd928.tar.gz
Qt-202af3021362d3c8066bc479a95e7aad889bd928.tar.bz2
Make the dynamic creation functions on the Qt object
Also updated examples to still work, and the dynamic example now uses exceptions a little, to demonstrate that it can be done. Exceptions are also now filled out with the QML error data. Task-number: QT-2801 Reviewed-by: Aaron Kennedy
Diffstat (limited to 'doc/src/declarative/globalobject.qdoc')
-rw-r--r--doc/src/declarative/globalobject.qdoc9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index 97f5d91..e2152b3 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -258,6 +258,11 @@ of their use.
}
\endcode
+ The methods and properties of the Component element are defined in its own
+ page, but when using it dynamically only two methods are usually used.
+ Component.createObject() returns the created object or null if there is an error.
+ If there is an error, Component.errorsString() describes what the error was.
+
If you want to just create an arbitrary string of QML, instead of
loading a QML file, consider the createQmlObject() function.
@@ -277,7 +282,9 @@ of their use.
similarly to eval, but for creating QML elements.
Returns the created object, or null if there is an error. In the case of an
- error, details of the error are output using qWarning().
+ error, a QtScript Error object is thrown. This object has the additional property,
+ qmlErrors, which is an array of all the errors encountered when trying to execute the
+ QML. Each object in the array has the members: lineNumber, columnNumber, fileName and message.
Note that this function returns immediately, and therefore may not work if
the QML loads new components. If you are trying to load a new component,