diff options
author | Daniel Pesch <dpesch@blackberry.com> | 2014-01-20 18:37:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-21 09:14:29 +0100 |
commit | 1b53fb1b6f00fe6bef787d385dddc48d52b090c6 (patch) | |
tree | 555282bb3bfa50a44991c30d67c4af91cd89faab /tools/qmlplugindump | |
parent | 4c5cd2f04fdaf946cc67896db7c190a318811d86 (diff) |
qmplugindump is not able to dump all registered components
This patch implements a new function QQmlMetaType::qmlAllTypes() used
by qmlplugindump that returns list of all registered components. Previous
implementation used QQmlMetaType::qmlATypes() call that returned only
components with defined QML name.
Task-number: QTBUG-36199
Change-Id: I85acba61cfa511973a004934cf0650f38cc46ed9
Signed-off-by: Daniel Pesch <dpesch@blackberry.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Diffstat (limited to 'tools/qmlplugindump')
-rw-r--r-- | tools/qmlplugindump/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 89af0905d5..000af0a1d8 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -182,6 +182,20 @@ QByteArray convertToId(const QMetaObject *mo) return className; } + +// Collect all metaobjects for types registered with qmlRegisterType() without parameters +void collectReachableMetaObjectsWithoutQmlName( QSet<const QMetaObject *>& metas ) { + foreach (const QQmlType *ty, QQmlMetaType::qmlAllTypes()) { + if ( ! metas.contains(ty->metaObject()) ) { + if (!ty->isComposite()) { + collectReachableMetaObjects(ty, &metas); + } else { + qmlTypesByCompositeName[ty->elementName()] = ty; + } + } + } +} + QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine, QSet<const QMetaObject *> &noncreatables, QSet<const QMetaObject *> &singletons, @@ -298,6 +312,8 @@ QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine, } } + collectReachableMetaObjectsWithoutQmlName(metas); + return metas; } |