diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qmlmetatype.cpp | 23 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetatype.h | 5 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index 5ebe970..091bd1b 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -190,6 +190,21 @@ QmlType::~QmlType() delete d; } +int QmlType::majorVersion() const +{ + return d->m_version_maj; +} + +int QmlType::minMinorVersion() const +{ + return d->m_version_min_from; +} + +int QmlType::maxMinorVersion() const +{ + return d->m_version_min_to; +} + bool QmlType::availableInVersion(int vmajor, int vminor) const { return vmajor == d->m_version_maj && vminor >= d->m_version_min_from && vminor <= d->m_version_min_to; @@ -879,6 +894,14 @@ QList<QByteArray> QmlMetaType::qmlTypeNames() return data->nameToType.keys(); } +QList<QmlType*> QmlMetaType::qmlTypes() +{ + QReadLocker lock(metaTypeDataLock()); + QmlMetaTypeData *data = metaTypeData(); + + return data->nameToType.values(); +} + /*! Copies \a copy into \a data, assuming they both are of type \a type. If \a copy is zero, a default type is copied. Returns true if the copy was diff --git a/src/declarative/qml/qmlmetatype.h b/src/declarative/qml/qmlmetatype.h index 94029ce..c388b1a 100644 --- a/src/declarative/qml/qmlmetatype.h +++ b/src/declarative/qml/qmlmetatype.h @@ -65,6 +65,7 @@ public: static bool copy(int type, void *data, const void *copy = 0); static QList<QByteArray> qmlTypeNames(); + static QList<QmlType*> qmlTypes(); static QmlType *qmlType(const QByteArray &, int, int); static QmlType *qmlType(const QMetaObject *); @@ -111,6 +112,10 @@ class Q_DECLARATIVE_EXPORT QmlType public: QByteArray typeName() const; QByteArray qmlTypeName() const; + + int majorVersion() const; + int minMinorVersion() const; + int maxMinorVersion() const; bool availableInVersion(int vmajor, int vminor) const; QByteArray hash() const; |