summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-04-19 21:42:49 +1000
committerAlan Alpert <alan.alpert@nokia.com>2010-04-21 17:13:51 +1000
commit202af3021362d3c8066bc479a95e7aad889bd928 (patch)
tree03587443c77403321c18e384b3277abd576e9ba3 /doc/src
parent2ac290f56c6ad4f3e236034a7b99ecdb598ecc3a (diff)
downloadqt4-tools-202af3021362d3c8066bc479a95e7aad889bd928.tar.gz
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')
-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 97f5d9177b..e2152b35bc 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,