summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlvme.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-09-03 00:52:45 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-09-03 00:52:45 (GMT)
commitc452c44d8cee138dcdd62f8c0f0db48b4ada5c40 (patch)
tree6901c957445a2fcae7559168752dd6b063f1af89 /src/declarative/qml/qmlvme.cpp
parent9260c597cc45e15943ad851f934ebb6e5ac1010a (diff)
downloadQt-c452c44d8cee138dcdd62f8c0f0db48b4ada5c40.zip
Qt-c452c44d8cee138dcdd62f8c0f0db48b4ada5c40.tar.gz
Qt-c452c44d8cee138dcdd62f8c0f0db48b4ada5c40.tar.bz2
Fix a bug in the qmlvme, which lead to an assert on valid QML.
As QmlComponents are created outside the CreateObject instruction, they could be created with an uninitalized declarative data member. Also this patch sets the column on CreateObject instructions too. Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative/qml/qmlvme.cpp')
-rw-r--r--src/declarative/qml/qmlvme.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index a49cbd3..4d133e3 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -222,6 +222,14 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, QmlCompiledData
case QmlInstruction::CreateComponent:
{
QObject *qcomp = new QmlComponent(ctxt->engine(), comp, ii + 1, instr.createComponent.count, stack.isEmpty() ? 0 : stack.top());
+
+ QmlEngine::setContextForObject(qcomp, ctxt);
+ QmlDeclarativeData *ddata = QmlDeclarativeData::get(qcomp);
+ Q_ASSERT(ddata);
+ ddata->outerContext = ctxt;
+ ddata->lineNumber = instr.line;
+ ddata->columnNumber = instr.create.column;
+
stack.push(qcomp);
ii += instr.createComponent.count;
}