aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject_p.h
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-01-27 11:33:37 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-15 00:22:45 +0100
commitb06108350b1390b51886474628e03e2e84640548 (patch)
treebbf00677d9edc64e2549f2cc3ee42f1edd5a50f4 /src/qml/qml/qqmlvmemetaobject_p.h
parenta27fd584df0ec3d1d072501d8fefe576a97a2e53 (diff)
Ensure that dynamic property storing QObject ptr notifies on delete
Previously, when a QObject ptr was stored in a dynamic variant property, the value of the property could change (to a zero ptr) if the QObject was deleted without a notify signal being emitted by the QDeclarativeVMEMetaObject which stores the property. This commit ensures that such a notify signal is emitted correctly. Task-number: QTBUG-23451 Change-Id: I5689abd984b177737f8d5f18950838b73ebde328 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject_p.h')
-rw-r--r--src/qml/qml/qqmlvmemetaobject_p.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h
index deee989383..84c88fdd7b 100644
--- a/src/qml/qml/qqmlvmemetaobject_p.h
+++ b/src/qml/qml/qqmlvmemetaobject_p.h
@@ -136,6 +136,19 @@ struct QQmlVMEMetaData
}
};
+class QQmlVMEMetaObject;
+class QQmlVMEVariantQObjectPtr : public QQmlGuard<QObject>
+{
+public:
+ inline QQmlVMEVariantQObjectPtr();
+ inline ~QQmlVMEVariantQObjectPtr();
+ inline void objectDestroyed(QObject *);
+ inline void setGuardedValue(QObject *obj, QQmlVMEMetaObject *target, int index);
+
+ QQmlVMEMetaObject *m_target;
+ int m_index;
+};
+
class QV8QObjectWrapper;
class QQmlVMEVariant;
class QQmlRefCount;
@@ -163,6 +176,7 @@ protected:
private:
friend class QQmlVMEMetaObjectEndpoint;
+ friend class QQmlVMEVariantQObjectPtr;
QObject *object;
QQmlCompiledData *compiledData;