diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-30 01:07:07 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-05 02:39:02 (GMT) |
commit | 49527e854a9edb0a92e64264d6efac6be46cf0ed (patch) | |
tree | 2bcc8dad3c1e6c0a239eac5e3188c2ec8eada602 /src/declarative/qml/qmlengine_p.h | |
parent | c4190288ca68eca9b84ccab67d860517a6a8e7c5 (diff) | |
download | Qt-49527e854a9edb0a92e64264d6efac6be46cf0ed.zip Qt-49527e854a9edb0a92e64264d6efac6be46cf0ed.tar.gz Qt-49527e854a9edb0a92e64264d6efac6be46cf0ed.tar.bz2 |
Create a property cache for synthesized metaobjects
Diffstat (limited to 'src/declarative/qml/qmlengine_p.h')
-rw-r--r-- | src/declarative/qml/qmlengine_p.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 74e24d4..68019e2 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -72,6 +72,7 @@ #include <QtDeclarative/qmlexpression.h> #include <QtScript/qscriptengine.h> #include <private/qmlmetaproperty_p.h> +#include <private/qmlpropertycache_p.h> QT_BEGIN_NAMESPACE @@ -88,6 +89,7 @@ class QScriptEngineDebugger; class QNetworkReply; class QNetworkAccessManager; class QmlAbstractBinding; +class QScriptDeclarativeClass; class QmlEnginePrivate : public QObjectPrivate { @@ -149,6 +151,7 @@ public: } resolveData; QmlContextScriptClass *contextClass; QmlObjectScriptClass *objectClass; + QScriptDeclarativeClass *objectClass2; QmlValueTypeScriptClass *valueTypeClass; QmlTypeNameScriptClass *typeNameClass; // Used by DOM Core 3 API @@ -212,10 +215,17 @@ public: // ### Fixme typedef QHash<QPair<const QMetaObject *, QString>, bool> FunctionCache; FunctionCache functionCache; - QHash<const QMetaObject *, QmlMetaObjectCache> propertyCache; - static QmlMetaObjectCache *cache(QmlEnginePrivate *priv, QObject *obj) { - if (!priv || !obj || QObjectPrivate::get(obj)->metaObject) return 0; - return &priv->propertyCache[obj->metaObject()]; + QHash<const QMetaObject *, QmlPropertyCache *> propertyCache; + QmlPropertyCache *cache(QObject *obj) { + Q_Q(QmlEngine); + if (!obj || QObjectPrivate::get(obj)->metaObject) return 0; + const QMetaObject *mo = obj->metaObject(); + QmlPropertyCache *rv = propertyCache.value(mo); + if (!rv) { + rv = QmlPropertyCache::create(q, mo); + propertyCache.insert(mo, rv); + } + return rv; } struct Imports { |