diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-27 05:36:11 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-27 05:36:11 (GMT) |
commit | 9f941fd65083ae6d3f2f5441bf60346821932218 (patch) | |
tree | 4ccd25dd9de4835a551534de37a931e2105fa4d3 /src/declarative/qml/qmlvme.cpp | |
parent | f75b524b060682a896ac7a3951ac677d29e15727 (diff) | |
download | Qt-9f941fd65083ae6d3f2f5441bf60346821932218.zip Qt-9f941fd65083ae6d3f2f5441bf60346821932218.tar.gz Qt-9f941fd65083ae6d3f2f5441bf60346821932218.tar.bz2 |
Add a declarative data ptr to QObjectPrivate
This data ptr does not increase the size of the QObject, as we take advantage of space only used during destruction. Currently this data is only used to store an object's QmlContext, but it will be used for more later.
Diffstat (limited to 'src/declarative/qml/qmlvme.cpp')
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 966ef8a..b6d9173 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -253,7 +253,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in #ifdef Q_ENABLE_PERFORMANCE_LOG QFxCompilerTimer<QFxCompiler::InstrCreateObject> cc; #endif - QObject *o = types.at(instr.create.type).createInstance(); + QObject *o = types.at(instr.create.type).createInstance(QmlContext::activeContext()); if(!o) VME_EXCEPTION("Unable to create object of type" << types.at(instr.create.type).className); @@ -276,6 +276,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in QObject *o = QmlMetaType::toQObject(v); if(!o) VME_EXCEPTION("Unable to create" << types.at(instr.create.type).className); + QmlEngine::setContextForObject(o, QmlContext::activeContext()); if(!stack.isEmpty()) { QObject *parent = stack.top(); |