diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-04 03:18:37 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-04 03:34:52 (GMT) |
commit | 588093b3e12dd5039bcc4ee545d9d9112d25394f (patch) | |
tree | 2f401dd36f44004fb06cead7846965dad3b5738e /src/declarative/qml/qmlcontext_p.h | |
parent | dbda9ae7996d090cda296074fc02842f1dd2e0f7 (diff) | |
download | Qt-588093b3e12dd5039bcc4ee545d9d9112d25394f.zip Qt-588093b3e12dd5039bcc4ee545d9d9112d25394f.tar.gz Qt-588093b3e12dd5039bcc4ee545d9d9112d25394f.tar.bz2 |
Improve performance by separating id and context properties
Diffstat (limited to 'src/declarative/qml/qmlcontext_p.h')
-rw-r--r-- | src/declarative/qml/qmlcontext_p.h | 18 |
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; }; |