aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-05-11 12:01:41 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-24 12:52:43 +0200
commitd2e557c2c2d7fcf3bf7c1676df3902e115986dc2 (patch)
tree65f47e443efa9635a2634880c01dc439817f9566 /src/qml/qml/qqmlengine_p.h
parent0a3ff88f851771e52d119fab90c0254de6950585 (diff)
Lazily create QMetaObjects
For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlengine_p.h')
-rw-r--r--src/qml/qml/qqmlengine_p.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index 8048e409f9..0631fe09ca 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -237,13 +237,12 @@ public:
QQmlMetaType::TypeCategory typeCategory(int) const;
bool isList(int) const;
int listType(int) const;
- const QMetaObject *rawMetaObjectForType(int) const;
- const QMetaObject *metaObjectForType(int) const;
- void registerCompositeType(const QMetaObject *);
- void unregisterCompositeType(const QMetaObject *);
-
- void clearCache();
- void trimCache();
+ QQmlMetaObject rawMetaObjectForType(int) const;
+ QQmlMetaObject metaObjectForType(int) const;
+ QQmlPropertyCache *propertyCacheForType(int);
+ QQmlPropertyCache *rawPropertyCacheForType(int);
+ void registerCompositeType(QQmlCompiledData *);
+ void unregisterCompositeType(QQmlCompiledData *);
bool isTypeLoaded(const QUrl &url) const;
bool isScriptLoaded(const QUrl &url) const;
@@ -302,15 +301,13 @@ private:
QQmlPropertyCache *createCache(const QMetaObject *);
QQmlPropertyCache *createCache(QQmlType *, int, QQmlError &error);
- void typeUnloaded(QQmlTypeData *typeData);
-
// These members must be protected by a QQmlEnginePrivate::Locker as they are required by
// the threaded loader. Only access them through their respective accessor methods.
QHash<QQmlMetaType::ModuleApi, QQmlMetaType::ModuleApiInstance *> moduleApiInstances;
QHash<const QMetaObject *, QQmlPropertyCache *> propertyCache;
QHash<QPair<QQmlType *, int>, QQmlPropertyCache *> typePropertyCache;
QHash<int, int> m_qmlLists;
- QHash<int, const QMetaObject *> m_compositeTypes;
+ QHash<int, QQmlCompiledData *> m_compositeTypes;
QHash<QUrl, QByteArray> debugChangesHash;
// These members is protected by the full QQmlEnginePrivate::mutex mutex