summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qmlcompiler.cpp2
-rw-r--r--src/declarative/qml/qmlinstruction_p.h1
-rw-r--r--src/declarative/qml/qmlvme.cpp8
3 files changed, 11 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index c0f7bfd..c411b8d 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -781,6 +781,7 @@ void QmlCompiler::genObject(QmlParser::Object *obj)
QmlInstruction create;
create.type = QmlInstruction::CreateObject;
create.line = obj->location.start.line;
+ create.create.column = obj->location.start.column;
create.create.data = -1;
if (!obj->custom.isEmpty())
create.create.data = output->indexForByteArray(obj->custom);
@@ -937,6 +938,7 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
QmlInstruction create;
create.type = QmlInstruction::CreateComponent;
create.line = root->location.start.line;
+ create.createComponent.column = root->location.start.column;
create.createComponent.endLine = root->location.end.line;
output->bytecode << create;
int count = output->bytecode.count();
diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h
index ede06a2..3c6af1b 100644
--- a/src/declarative/qml/qmlinstruction_p.h
+++ b/src/declarative/qml/qmlinstruction_p.h
@@ -284,6 +284,7 @@ public:
} assignSignalObject;
struct {
int count;
+ ushort column;
int endLine;
int metaObject;
} createComponent;
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;
}