aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-20 22:02:11 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-09 14:28:31 +0000
commit1079dbbdd96c517eed3269e4a5e18f18a6808be0 (patch)
tree6e0aa988e2996196701c5728323b86ea49f5074d /src/qml/qml/qqmltypeloader.cpp
parent08a7ae47c24c1378cb39d0c796fcc37cc0c62b32 (diff)
Pass a QmlContext to QV4::Script instead of a contextwrapper
Change-Id: Ia8db166aacbbe6e8f588179dffa04e2dce9566cb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index eb65f732dd..5f30b83bbd 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2538,10 +2538,11 @@ QV4::PersistentValue QQmlScriptData::scriptValueForContext(QQmlContextData *pare
return QV4::PersistentValue();
}
- QV4::Scoped<QV4::QmlContextWrapper> qmlglobal(scope, QV4::QmlContextWrapper::qmlScope(v4, ctxt, 0));
- qmlglobal->takeContextOwnership();
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, v4->rootContext()->newQmlContext(ctxt, 0));
+ QV4::Scoped<QV4::QmlContextWrapper> w(scope, qmlContext->d()->qml);
+ w->takeContextOwnership();
- m_program->qml.set(scope.engine, qmlglobal);
+ m_program->qmlContext.set(scope.engine, qmlContext);
m_program->run();
if (scope.engine->hasException) {
QQmlError error = scope.engine->catchExceptionAsQmlError();
@@ -2549,7 +2550,7 @@ QV4::PersistentValue QQmlScriptData::scriptValueForContext(QQmlContextData *pare
ep->warning(error);
}
- rv.set(scope.engine, qmlglobal);
+ rv.set(scope.engine, w);
if (shared) {
m_value = rv;
m_loaded = true;