aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlcomponent.cpp')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index addee70b6b..f54eee3e72 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -862,8 +862,16 @@ QObject *QQmlComponent::create(QQmlContext *context)
Q_D(QQmlComponent);
QObject *rv = d->doBeginCreate(this, context);
- if (rv)
+ if (rv) {
completeCreate();
+ } else if (d->state.completePending) {
+ // overridden completCreate might assume that
+ // the object has actually been created
+ ++creationDepth.localData();
+ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(d->engine);
+ d->complete(ep, &d->state);
+ --creationDepth.localData();
+ }
if (rv && !d->requiredProperties().empty()) {
delete rv;
return nullptr;