From d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 11 May 2012 12:01:41 +0100 Subject: 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 --- src/qml/qml/qqmlproperty_p.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/qml/qml/qqmlproperty_p.h') diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h index cba7849ea0..4f0db342c2 100644 --- a/src/qml/qml/qqmlproperty_p.h +++ b/src/qml/qml/qqmlproperty_p.h @@ -101,7 +101,7 @@ public: QVariant readValueProperty(); bool writeValueProperty(const QVariant &, WriteFlags); - static const QMetaObject *rawMetaObjectForType(QQmlEnginePrivate *, int); + static QQmlMetaObject rawMetaObjectForType(QQmlEnginePrivate *, int); static bool writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags); static bool writeValueProperty(QObject *, QQmlEngine *, @@ -122,15 +122,13 @@ public: static QQmlAbstractBinding *binding(QObject *, int coreIndex, int valueTypeIndex /* -1 */); - static QQmlPropertyData saveValueType(const QMetaObject *, int, - const QMetaObject *, int, - QQmlEngine *); + static QQmlPropertyData saveValueType(const QQmlPropertyData &, + const QMetaObject *, int, + QQmlEngine *); static QQmlProperty restore(QObject *, const QQmlPropertyData &, QQmlContextData *); - static bool equal(const QMetaObject *, const QMetaObject *); - static bool canConvert(const QMetaObject *from, const QMetaObject *to); static inline QQmlPropertyPrivate *get(const QQmlProperty &p) { return p.d; } @@ -158,7 +156,6 @@ public: static bool connect(const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type = 0, int *types = 0); - static const QMetaObject *metaObjectForProperty(const QMetaObject *, int); static void flushSignal(const QObject *sender, int signal_index); }; -- cgit v1.2.3