aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qmlcontext_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-07-04 16:07:50 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-07-05 09:05:55 +0000
commitcfb17c44cf3ae1268d066ba414759068059a7bbd (patch)
tree58efa2997a5ac52b7d1f11ec0c8de2754f02f03b /src/qml/jsruntime/qv4qmlcontext_p.h
parent79ceef9f467d065c6e921892e9cc4ed46a0183cc (diff)
Simplify and unite handling of activation objects in Contexts
All ExecutionContexts (except for CatchContext) have or can have some sort of activation object. Unify them in one pointer in the ExecutionContext class, and unify it's handling where it's actually the same. Change-Id: I6750999ddbd5d1d74235ef4b34dcd7546c432541 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qmlcontext_p.h')
-rw-r--r--src/qml/jsruntime/qv4qmlcontext_p.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4qmlcontext_p.h b/src/qml/jsruntime/qv4qmlcontext_p.h
index 2f1dbabaf2..9faf58d496 100644
--- a/src/qml/jsruntime/qv4qmlcontext_p.h
+++ b/src/qml/jsruntime/qv4qmlcontext_p.h
@@ -77,12 +77,12 @@ struct QQmlContextWrapper : Object {
QQmlQPointer<QObject> scopeObject;
};
-#define QmlContextMembers(class, Member) \
- Member(class, Pointer, QQmlContextWrapper *, qml)
+#define QmlContextMembers(class, Member)
DECLARE_HEAP_OBJECT(QmlContext, ExecutionContext) {
DECLARE_MARK_TABLE(QmlContext);
+ QQmlContextWrapper *qml() { return static_cast<QQmlContextWrapper *>(activation.get()); }
void init(QV4::ExecutionContext *outerContext, QV4::QQmlContextWrapper *qml);
};
@@ -114,14 +114,14 @@ struct Q_QML_EXPORT QmlContext : public ExecutionContext
static Heap::QmlContext *create(QV4::ExecutionContext *parent, QQmlContextData *context, QObject *scopeObject);
QObject *qmlScope() const {
- return d()->qml->scopeObject;
+ return d()->qml()->scopeObject;
}
QQmlContextData *qmlContext() const {
- return *d()->qml->context;
+ return *d()->qml()->context;
}
void takeContextOwnership() {
- d()->qml->ownsContext = true;
+ d()->qml()->ownsContext = true;
}
};