qmltyperegistrar: Remove QML.ManualRegistration

This was needed because we couldn't automatically generate the types for
the Qt object/namespace. Now we can. We should not offer this
possibility to users as we need to see all the types at compile time.
Such an escape hatch will only give us problems in the future.

Change-Id: Ib86fddd0352cf1877a4123cad273c99c4252d8ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Ulf Hermann 2021-01-18 12:13:44 +01:00
parent bdb2b66f3d
commit 1fa352f0e0
3 changed files with 1 additions and 18 deletions

View File

@ -303,20 +303,6 @@ void MetaTypesJsonProcessor::processTypes(const QJsonObject &types)
qPrintable(include));
}
m_includes.append(include);
{
bool shouldRegister = true;
const QJsonArray classInfos = classDef.value(QLatin1String("classInfos")).toArray();
for (const QJsonValue &v : classInfos) {
if (v[QLatin1String("name")].toString()
== QLatin1String("QML.ManualRegistration")) {
shouldRegister = QStringView(u"true").compare(
v[QLatin1String("value")].toString(),
Qt::CaseInsensitive) != 0;
}
}
classDef.insert(QLatin1String("registerable"), shouldRegister);
}
m_types.append(classDef);
break;
}

View File

@ -209,9 +209,6 @@ int main(int argc, char **argv)
const QVector<QJsonObject> types = processor.types();
for (const QJsonObject &classDef : types) {
if (!classDef.value(QLatin1String("registerable")).toBool())
continue;
const QString className = classDef[QLatin1String("qualifiedClassName")].toString();
if (classDef.value(QLatin1String("namespace")).toBool()) {

View File

@ -126,7 +126,7 @@ void QmlTypesClassDescription::collect(
const QJsonObject *classDef, const QVector<QJsonObject> &types,
const QVector<QJsonObject> &foreign, CollectMode mode, QTypeRevision defaultRevision)
{
if (file.isEmpty() && classDef->value(QLatin1String("registerable")).toBool())
if (file.isEmpty())
file = classDef->value(QLatin1String("inputFile")).toString();
const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray();