diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-07-04 12:37:38 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-04 10:12:10 +0200 |
commit | 8a9c661568a3caa3dd72dfe92aeed92ba2a03383 (patch) | |
tree | b89dcd6cf461f9b2a3f9b3f8a10437310902ac91 | |
parent | 6a013bf73b27f112bc7cff04225b92d893804b29 (diff) |
Document QQmlComponent::create(QQmlIncubator&, ...)
Task-number: QTBUG-25132
Change-Id: Ice6c75cbd7a45519ce7f38190db3fae95146269e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 0c22382f8d..c8f59c0055 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -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, |