diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-11-14 21:39:08 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-23 14:51:04 +0100 |
commit | c9adc7661a7eef4f2eefb51f02c0393be2ec3898 (patch) | |
tree | 0f88e9f0cb8784e28982c56c2ba393fb886614c8 /src/qml/qml/qqmlpropertycache_p.h | |
parent | e66cf24a8dfd010bf43b7ed92c8f5679ea848c0b (diff) |
Move methodParameterTypes and methodReturnType helper functions
These can extract the type information from either a property cache (through
QQmlData from a QObject) or (fallback) from a QMetaObject. The difference
between a QMetaObject and a QQmlPropertyCache is what QQmlMetaObject abstracts
and therefore we can move the functions there. This is in preparation for
gadget support and also avoids the repeated QQmlData::get() dance but allows
the re-use of a QQmlMetaObject instance in the future to do that dance only
once.
Change-Id: Ibff6ce498d09fabc97e0801653edc5b1ff446c6a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 524546e737..82217f3b22 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -305,10 +305,6 @@ public: QQmlContextData *, QQmlPropertyData &); static QQmlPropertyData *property(QQmlEngine *, QObject *, const QV4::String *, QQmlContextData *, QQmlPropertyData &); - static int *methodParameterTypes(QObject *, int index, QVarLengthArray<int, 9> &dummy, - QByteArray *unknownTypeError); - static int methodReturnType(QObject *, const QQmlPropertyData &data, - QByteArray *unknownTypeError); //see QMetaObjectPrivate::originalClone int originalClone(int index); @@ -340,6 +336,7 @@ private: friend class QQmlCompiler; friend class QQmlPropertyCacheCreator; friend class QQmlComponentAndAliasResolver; + friend class QQmlMetaObject; inline QQmlPropertyCache *copy(int reserve); @@ -428,6 +425,9 @@ public: QQmlPropertyCache *propertyCache(QQmlEnginePrivate *) const; + int methodReturnType(const QQmlPropertyData &data, QByteArray *unknownTypeError) const; + int *methodParameterTypes(int index, QVarLengthArray<int, 9> &dummy, QByteArray *unknownTypeError) const; + static bool canConvert(const QQmlMetaObject &from, const QQmlMetaObject &to); private: |