summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontext_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qmlcontext_p.h')
-rw-r--r--src/declarative/qml/qmlcontext_p.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h
index fc615b6..5bb3aaf 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qmlcontext_p.h
@@ -59,6 +59,7 @@
#include <QtCore/qhash.h>
#include <QtScript/qscriptvalue.h>
#include <QtCore/qset.h>
+#include <private/qguard_p.h>
QT_BEGIN_NAMESPACE
@@ -96,8 +97,6 @@ public:
void dump();
void dump(int depth);
- void destroyed(QObject *);
-
enum Priority {
HighPriority,
NormalPriority
@@ -111,6 +110,21 @@ public:
QmlSimpleDeclarativeData contextData;
QObjectList contextObjects;
+
+ struct ContextGuard : public QGuard<QObject>
+ {
+ QmlContextPrivate *priv;
+ ContextGuard &operator=(QObject *obj) {
+ (QGuard<QObject>&)*this = obj; return *this;
+ }
+ void objectDestroyed(QObject *o) { priv->destroyed(this); }
+ };
+ ContextGuard *idValues;
+ int idValueCount;
+ void setIdProperty(const QString &, int, QObject *);
+ void setIdPropertyCount(int);
+ void destroyed(ContextGuard *);
+
// Only used for debugging
QList<QPointer<QObject> > instances;
};