aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetypewrapper_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlvaluetypewrapper_p.h')
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper_p.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper_p.h b/src/qml/qml/qqmlvaluetypewrapper_p.h
index 94eeba366a..fec54df770 100644
--- a/src/qml/qml/qqmlvaluetypewrapper_p.h
+++ b/src/qml/qml/qqmlvaluetypewrapper_p.h
@@ -66,14 +66,24 @@ namespace QV4 {
namespace Heap {
struct QQmlValueTypeWrapper : Object {
- QQmlValueTypeWrapper() {}
- ~QQmlValueTypeWrapper();
- QQmlRefPointer<QQmlPropertyCache> propertyCache;
+ void init() { Object::init(); }
+ void destroy();
+ QQmlPropertyCache *propertyCache() const { return _propertyCache; }
+ void setPropertyCache(QQmlPropertyCache *c) {
+ if (c)
+ c->addref();
+ if (_propertyCache)
+ _propertyCache->release();
+ _propertyCache = c;
+ }
mutable void *gadgetPtr;
QQmlValueType *valueType;
void setValue(const QVariant &value) const;
QVariant toVariant() const;
+
+private:
+ QQmlPropertyCache *_propertyCache;
};
}
@@ -82,7 +92,7 @@ struct Q_QML_EXPORT QQmlValueTypeWrapper : Object
{
V4_OBJECT2(QQmlValueTypeWrapper, Object)
V4_PROTOTYPE(valueTypeWrapperPrototype)
- static void destroy(Heap::Base *b);
+ V4_NEEDS_DESTROY
public:
@@ -91,7 +101,7 @@ public:
QVariant toVariant() const;
bool toGadget(void *data) const;
- bool isEqual(const QVariant& value);
+ bool isEqual(const QVariant& value) const;
int typeId() const;
bool write(QObject *target, int propertyIndex) const;