Document QQmlComponent::create(QQmlIncubator&, ...)
authorMartin Jones <martin.jones@nokia.com>
Wed, 4 Jul 2012 02:37:38 +0000 (12:37 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 4 Jul 2012 08:12:10 +0000 (10:12 +0200)
Task-number: QTBUG-25132
Change-Id: Ice6c75cbd7a45519ce7f38190db3fae95146269e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
src/qml/qml/qqmlcomponent.cpp

index 0c22382..c8f59c0 100644 (file)
@@ -971,7 +971,27 @@ QQmlComponentAttached *QQmlComponent::qmlAttachedProperties(QObject *obj)
     return a;
 }
 
-void QQmlComponent::create(QQmlIncubator &i, QQmlContext *context,
+/*!
+    Create an object instance from this component using the provided
+    \a incubator.  \a context specifies the context within which to create the object
+    instance.
+
+    If \a context is 0 (the default), it will create the instance in the
+    engine's \l {QQmlEngine::rootContext()}{root context}.
+
+    \a forContext specifies a context that this object creation depends upon.
+    If the \a forContext is being created asynchronously, and the
+    \l QQmlIncubator::IncubationMode is \l QQmlIncubator::AsynchronousIfNested,
+    this object will also be created asynchronously.  If \a forContext is 0
+    (the default), the \a context will be used for this decision.
+
+    The created object and its creation status are available via the
+    \a incubator.
+
+    \sa QQmlIncubator
+*/
+
+void QQmlComponent::create(QQmlIncubator &incubator, QQmlContext *context,
                                    QQmlContext *forContext)
 {
     Q_D(QQmlComponent);
@@ -998,8 +1018,8 @@ void QQmlComponent::create(QQmlIncubator &i, QQmlContext *context,
         return;
     }
 
-    i.clear();
-    QQmlIncubatorPrivate *p = i.d;
+    incubator.clear();
+    QQmlIncubatorPrivate *p = incubator.d;
 
     QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(d->engine);
 
@@ -1007,7 +1027,7 @@ void QQmlComponent::create(QQmlIncubator &i, QQmlContext *context,
     p->compiledData->addref();
     p->vme.init(contextData, d->cc, d->start, d->creationContext);
 
-    enginePriv->incubate(i, forContextData);
+    enginePriv->incubate(incubator, forContextData);
 }
 
 class QV8IncubatorResource : public QV8ObjectResource,