diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/declarative/dynamicobjects.qdoc | 14 | ||||
-rw-r--r-- | doc/src/declarative/globalobject.qdoc | 3 |
2 files changed, 7 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 diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index 47460cf..7c27ae4 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -226,6 +226,9 @@ This function causes the QML engine to emit the quit signal, which in This function returns \c url resolved relative to the URL of the caller. +\section3 Qt.fontFamilies() +This function returns a list of the font families available to the application. + \section3 Qt.isQtObject(object) Returns true if \c object is a valid reference to a Qt or QML object, otherwise false. |