diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-04-30 05:42:02 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-04-30 05:42:02 (GMT) |
commit | e4b865ef512e338cf495226dc98540f45fba1d9f (patch) | |
tree | a012335c719fe9bf510e075bd19ff44e717046c0 | |
parent | 77cddec6ea642b073d1d9c017c865e740c0c60bc (diff) | |
download | Qt-e4b865ef512e338cf495226dc98540f45fba1d9f.zip Qt-e4b865ef512e338cf495226dc98540f45fba1d9f.tar.gz Qt-e4b865ef512e338cf495226dc98540f45fba1d9f.tar.bz2 |
More doc fixes
-rw-r--r-- | doc/src/declarative/dynamicobjects.qdoc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc index c376266..5cdd768 100644 --- a/doc/src/declarative/dynamicobjects.qdoc +++ b/doc/src/declarative/dynamicobjects.qdoc @@ -68,7 +68,7 @@ the \l {Qt.createComponent(url file)}{Qt.createComponent()} function on the \l{Q This function takes the URL of the QML file as its only argument and returns a component object which can be used to create and load that QML file. -Once you have a component you can use its \c createObject() method to create an instance of +Once you have a component you can use its \l {Component::createObject()}{createObject()} method to create an instance of the component. Here is an example. Here is a \c Sprite.qml, which defines a simple QML component: @@ -123,19 +123,13 @@ The actual creation context depends on how an item is created: is the QDeclarativeContext in which this method is called \o If \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()} if called, it is the context of the item used as the second argument to this method -\o If a \c {Component \{\}} item is defined and \c {Component::}{createObject()} is called, - it is the context in which the \c Component item is defined +\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()} + is called on that item, it is the context in which the \c Component is defined +\endlist Also, note that while dynamically created objects may be used the same as other objects, they do not have an id in QML. -A restriction which you need to manage with dynamically created items, -is that the creation context must outlive the -created item. The creation context is the QDeclarativeContext in which \c Qt.createComponent() -was called, or the context in which the Component element, or the item used as the -second argument to \c Qt.createQmlObject(), was specified. If the creation -context is destroyed before the dynamic item is, then bindings in the dynamic item will -fail to work. \section1 Deleting Objects Dynamically You should generally avoid dynamically deleting objects that you did not |