diff options
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 11 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4context_p.h | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 6 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 667ea7025a..f50c5ab017 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -549,3 +549,14 @@ Heap::FunctionObject *ExecutionContext::getFunctionObject() const return 0; } + + +QObject *QmlContext::qmlScope() const +{ + return d()->qml->scopeObject; +} + +QQmlContextData *QmlContext::qmlContext() const +{ + return d()->qml->context; +} diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 1e051ed850..2667bbe0b2 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -38,6 +38,9 @@ QT_BEGIN_NAMESPACE +class QQmlContextData; +class QObject; + namespace QV4 { namespace CompiledData { @@ -218,6 +221,9 @@ struct WithContext : public ExecutionContext struct QmlContext : public ExecutionContext { V4_MANAGED(QmlContext, ExecutionContext) + + QObject *qmlScope() const; + QQmlContextData *qmlContext() const; }; inline CallContext *ExecutionContext::asCallContext() diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 02e4e8c7d3..23084fb202 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -336,8 +336,8 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C return; QV4::Scope scope(engine); - QV4::Scoped<QmlContextWrapper> contextWrapper(scope, engine->qmlContextObject()); - QQmlContextData *qmlContext = contextWrapper->getContext(); + QV4::Scoped<QmlContext> context(scope, engine->qmlContext()); + QQmlContextData *qmlContext = context->qmlContext(); const quint32 *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable(); const int idObjectDependencyCount = compiledFunction->nDependingIdObjects; @@ -355,7 +355,7 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C capture->captureProperty(qmlContext->contextObject, propertyIndex, notifyIndex); } - QObject *scopeObject = contextWrapper->getScopeObject(); + QObject *scopeObject = context->qmlScope(); const quint32 *scopePropertyDependency = compiledFunction->qmlScopePropertiesDependencyTable(); const int scopePropertyDependencyCount = compiledFunction->nDependingScopeProperties; for (int i = 0; i < scopePropertyDependencyCount; ++i) { |