diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-09-03 07:50:43 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-09-03 07:50:43 (GMT) |
commit | 250545f7996927fa151097857179b5895010506b (patch) | |
tree | 52915bb214d4b1805c3937497414ec22e7442f49 /src/declarative | |
parent | 982d7f659750f0864e2d874ce41289125f40a36b (diff) | |
download | Qt-250545f7996927fa151097857179b5895010506b.zip Qt-250545f7996927fa151097857179b5895010506b.tar.gz Qt-250545f7996927fa151097857179b5895010506b.tar.bz2 |
Complete Component::createObject() creation after setting the parent.
Task-number: QTBUG-13170
Reviewed-by: Alan Alpert
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 75bb5db..74de738 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -607,10 +607,11 @@ QScriptValue QDeclarativeComponent::createObject(QObject* parent) ctxt = d->engine->rootContext(); if (!ctxt) return QScriptValue(QScriptValue::NullValue); - QObject* ret = create(ctxt); - if (!ret) + QObject* ret = beginCreate(ctxt); + if (!ret) { + completeCreate(); return QScriptValue(QScriptValue::NullValue); - + } if (parent) { ret->setParent(parent); @@ -631,6 +632,7 @@ QScriptValue QDeclarativeComponent::createObject(QObject* parent) if (needParent) qWarning("QDeclarativeComponent: Created graphical object was not placed in the graphics scene."); } + completeCreate(); QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine); QDeclarativeData::get(ret, true)->setImplicitDestructible(); |