aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlplugindump/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmlplugindump/main.cpp')
-rw-r--r--tools/qmlplugindump/main.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 0238a4aaae..98c9b54bcd 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -32,6 +32,7 @@
****************************************************************************/
#include <QtQml/qqmlengine.h>
+#include <QtQml/private/qqmlengine_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
#include <QtQml/private/qqmlopenmetaobject_p.h>
#include <QtQuick/private/qquickevents_p_p.h>
@@ -129,11 +130,11 @@ void collectReachableMetaObjects(QObject *object, QSet<const QMetaObject *> *met
}
}
-void collectReachableMetaObjects(const QQmlType *ty, QSet<const QMetaObject *> *metas)
+void collectReachableMetaObjects(QQmlEnginePrivate *engine, const QQmlType *ty, QSet<const QMetaObject *> *metas)
{
collectReachableMetaObjects(ty->metaObject(), metas, ty->isExtendedType());
- if (ty->attachedPropertiesType())
- collectReachableMetaObjects(ty->attachedPropertiesType(), metas);
+ if (ty->attachedPropertiesType(engine))
+ collectReachableMetaObjects(ty->attachedPropertiesType(engine), metas);
}
/* We want to add the MetaObject for 'Qt' to the list, this is a
@@ -195,11 +196,11 @@ QByteArray convertToId(const QMetaObject *mo)
// Collect all metaobjects for types registered with qmlRegisterType() without parameters
-void collectReachableMetaObjectsWithoutQmlName( QSet<const QMetaObject *>& metas ) {
+void collectReachableMetaObjectsWithoutQmlName(QQmlEnginePrivate *engine, QSet<const QMetaObject *>& metas ) {
foreach (const QQmlType *ty, QQmlMetaType::qmlAllTypes()) {
if ( ! metas.contains(ty->metaObject()) ) {
if (!ty->isComposite()) {
- collectReachableMetaObjects(ty, &metas);
+ collectReachableMetaObjects(engine, ty, &metas);
} else {
qmlTypesByCompositeName[ty->elementName()] = ty;
}
@@ -225,7 +226,7 @@ QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine,
qmlTypesByCppName[ty->metaObject()->className()].insert(ty);
if (ty->isExtendedType())
extensions[ty->typeName()].insert(ty->metaObject()->className());
- collectReachableMetaObjects(ty, &metas);
+ collectReachableMetaObjects(QQmlEnginePrivate::get(engine), ty, &metas);
} else {
qmlTypesByCompositeName[ty->elementName()] = ty;
}
@@ -324,7 +325,7 @@ QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine,
}
}
- collectReachableMetaObjectsWithoutQmlName(metas);
+ collectReachableMetaObjectsWithoutQmlName(QQmlEnginePrivate::get(engine), metas);
return metas;
}
@@ -374,7 +375,7 @@ public:
if (qmlTyName.startsWith("./")) {
qmlTyName.remove(0, 2);
}
- if (qmlTyName.startsWith("/")) {
+ if (qmlTyName.startsWith(QLatin1Char('/'))) {
qmlTyName.remove(0, 1);
}
const QString exportString = enquote(
@@ -510,7 +511,7 @@ public:
qml->writeEndObject();
}
- void dump(const QMetaObject *meta, bool isUncreatable, bool isSingleton)
+ void dump(QQmlEnginePrivate *engine, const QMetaObject *meta, bool isUncreatable, bool isSingleton)
{
qml->writeStartObject("Component");
@@ -556,7 +557,7 @@ public:
}
qml->writeArrayBinding(QLatin1String("exportMetaObjectRevisions"), metaObjectRevisions);
- if (const QMetaObject *attachedType = (*qmlTypes.begin())->attachedPropertiesType()) {
+ if (const QMetaObject *attachedType = (*qmlTypes.begin())->attachedPropertiesType(engine)) {
// Can happen when a type is registered that returns itself as attachedPropertiesType()
// because there is no creatable type to attach to.
if (attachedType != meta) {
@@ -735,7 +736,7 @@ static bool readDependenciesData(QString dependenciesFile, const QByteArray &fil
std::cerr << "parsing "
<< qPrintable( dependenciesFile ) << " skipping";
foreach (const QString &uriToSkip, urisToSkip)
- std::cerr << " " << qPrintable(uriToSkip);
+ std::cerr << ' ' << qPrintable(uriToSkip);
std::cerr << std::endl;
}
QJsonParseError parseError;
@@ -828,7 +829,7 @@ static bool getDependencies(const QQmlEngine &engine, const QString &pluginImpor
if (!importScanner.waitForFinished()) {
std::cerr << "failure to start " << qPrintable(command);
foreach (const QString &arg, commandArgs)
- std::cerr << " " << qPrintable(arg);
+ std::cerr << ' ' << qPrintable(arg);
std::cerr << std::endl;
return false;
}
@@ -1173,7 +1174,7 @@ int main(int argc, char *argv[])
if (relocatable)
dumper.setRelocatableModuleUri(pluginImportUri);
foreach (const QMetaObject *meta, nameToMeta) {
- dumper.dump(meta, uncreatableMetas.contains(meta), singletonMetas.contains(meta));
+ dumper.dump(QQmlEnginePrivate::get(&engine), meta, uncreatableMetas.contains(meta), singletonMetas.contains(meta));
}
foreach (const QQmlType *compositeType, qmlTypesByCompositeName)
dumper.dumpComposite(&engine, compositeType, defaultReachableNames);