diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-04-29 16:51:54 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:06 +0200 |
commit | 053eb96c31a5d24ce8cda41dbb46b1df27e03bfb (patch) | |
tree | e4cb8d9aaa264248daad2a451a9a2f1e25983033 /src/qml/qml/qqmlcontextwrapper_p.h | |
parent | f78e0a52c46fd79794e3b2c04361babc2f06761a (diff) |
Convert the context wrapper to the new storage layout
Change-Id: Ie6263076e003af031e3faa9e5ca7b1f57140f347
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper_p.h')
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper_p.h | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h index 3facf71aa0..31716fe672 100644 --- a/src/qml/qml/qqmlcontextwrapper_p.h +++ b/src/qml/qml/qqmlcontextwrapper_p.h @@ -73,7 +73,26 @@ struct QQmlIdObjectsArray; struct Q_QML_EXPORT QmlContextWrapper : Object { - V4_OBJECT + struct Data : Object::Data { + bool readOnly; + bool ownsContext; + bool isNullWrapper; + + QQmlGuardedContextData context; + QPointer<QObject> scopeObject; + QQmlIdObjectsArray *idObjectsWrapper; + }; + struct { + bool readOnly; + bool ownsContext; + bool isNullWrapper; + + QQmlGuardedContextData context; + QPointer<QObject> scopeObject; + QQmlIdObjectsArray *idObjectsWrapper; + } __data; + + V4_OBJECT_NEW QmlContextWrapper(QV8Engine *engine, QQmlContextData *context, QObject *scopeObject, bool ownsContext = false); ~QmlContextWrapper(); @@ -83,11 +102,11 @@ struct Q_QML_EXPORT QmlContextWrapper : Object static QQmlContextData *callingContext(ExecutionEngine *v4); static void takeContextOwnership(const ValueRef qmlglobal); - inline QObject *getScopeObject() const { return scopeObject; } - inline QQmlContextData *getContext() const { return context; } + inline QObject *getScopeObject() const { return d()->scopeObject; } + inline QQmlContextData *getContext() const { return d()->context; } static QQmlContextData *getContext(const ValueRef value); - void setReadOnly(bool b) { readOnly = b; } + void setReadOnly(bool b) { d()->readOnly = b; } static ReturnedValue get(Managed *m, const StringRef name, bool *hasProperty); static void put(Managed *m, const StringRef name, const ValueRef value); @@ -99,25 +118,23 @@ struct Q_QML_EXPORT QmlContextWrapper : Object ReturnedValue idObjectsArray(); ReturnedValue qmlSingletonWrapper(QV8Engine *e, const StringRef &name); - bool readOnly; - bool ownsContext; - bool isNullWrapper; - - QQmlGuardedContextData context; - QPointer<QObject> scopeObject; -private: - QQmlIdObjectsArray *idObjectsWrapper; }; struct QQmlIdObjectsArray : public Object { - V4_OBJECT + struct Data : Object::Data { + QmlContextWrapper *contextWrapper; + }; + struct { + QmlContextWrapper *contextWrapper; + } __data; + + V4_OBJECT_NEW QQmlIdObjectsArray(ExecutionEngine *engine, QmlContextWrapper *contextWrapper); static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty); static void markObjects(Managed *that, ExecutionEngine *engine); - QmlContextWrapper *contextWrapper; }; } |