\l{QML Signal and Handler Event System#Connecting Signals to Methods and Signals}
{Connecting Signals to Methods and Signals} for more information.
+It is also possible to instantiate components without blocking via the
+\l {Component::incubateObject()}{incubateObject()} function.
+
\section2 Creating an Object from a String of QML
\li If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
if called, the creation context is the context of the parent item passed to this method
\li If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
- is called on that item, the creation context is the context in which the \c Component is defined
+ or \l {Component::incubateObject()}{incubateObject()} is called on that item,
+ the creation context 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
Dynamically created instances can be deleted with the \c destroy() method.
See \l {Dynamic Object Management in QML} for more information.
+
+ \sa incubateObject()
*/
void QQmlComponent::createObject(QQmlV8Function *args)
{
}
/*!
- \qmlmethod object Component::incubateObject(Item parent, object properties, enum mode)
+ \qmlmethod object Component::incubateObject(Item parent, object properties, enumeration mode)
Creates an incubator for instance of this component. Incubators allow new component
instances to be instantiated asynchronously and not cause freezes in the UI.
print ("Object", incubator.object, "is ready immediately!");
}
\endjs
+
+ Dynamically created instances can be deleted with the \c destroy() method.
+ See \l {Dynamic Object Management in QML} for more information.
+
+ \sa createObject()
*/
void QQmlComponent::incubateObject(QQmlV8Function *args)
\brief The Loader item allows dynamically loading an Item-based
subtree from a URL or Component.
- Loader is used to dynamically load visual QML components. It can load a
+ Loader is used to dynamically load visual QML components. For loading non-visual
+ components, see \l {Dynamic Object Management in QML}.
+
+ Loader can load a
QML file (using the \l source property) or a \l Component object (using
the \l sourceComponent property). It is useful for delaying the creation
of a component until it is required: for example, when a component should