aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-01 14:51:15 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-02-08 09:24:43 +0000
commit56a5103781a17a2ae0369bbd468d7103d8df6d6b (patch)
tree8c34822bbe2c332c6b6a57e968785a21ec8bbfc2
parent92f2447cf3850303f161271c049a5b8d0a55b9f5 (diff)
Move registration functions from qqmlimport.cpp to qqmlmetatype.cpp
These functions require the metatype data in multiple interdependent places. If they are executed concurrently data races are almost guaranteed. Move the functions to qqmlmetatype.cpp and keep the metatype mutex locked for their duration. Access to the internals of the metatype system also allows us to significantly simplify the logic. Additionally we can remove methods only used by those functions from the public interface of QQmlMetaType now. Task-number: QTBUG-73271 Change-Id: I1279259cca5cb5be63026d5b74f5d013e7a1ac5c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/qml/qml/qml.pri2
-rw-r--r--src/qml/qml/qqmlimport.cpp167
-rw-r--r--src/qml/qml/qqmlmetatype.cpp203
-rw-r--r--src/qml/qml/qqmlmetatype_p.h16
-rw-r--r--src/qml/qml/qqmlmetatypedata_p.h15
-rw-r--r--src/qml/qml/qqmlmetatyperegistrationfailurerecorder.cpp57
-rw-r--r--src/qml/qml/qqmlmetatyperegistrationfailurerecorder_p.h72
7 files changed, 208 insertions, 324 deletions
diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri
index 9c3d4e6e26..0895e5ae68 100644
--- a/src/qml/qml/qml.pri
+++ b/src/qml/qml/qml.pri
@@ -15,7 +15,6 @@ SOURCES += \
$$PWD/qqmlvme.cpp \
$$PWD/qqmlboundsignal.cpp \
$$PWD/qqmlmetatype.cpp \
- $$PWD/qqmlmetatyperegistrationfailurerecorder.cpp \
$$PWD/qqmlmetatypedata.cpp \
$$PWD/qqmlstringconverters.cpp \
$$PWD/qqmltype.cpp \
@@ -78,7 +77,6 @@ HEADERS += \
$$PWD/qqmlprivate.h \
$$PWD/qqmlmetatype_p.h \
$$PWD/qqmlmetatypedata_p.h \
- $$PWD/qqmlmetatyperegistrationfailurerecorder_p.h \
$$PWD/qqmltype_p.h \
$$PWD/qqmltype_p_p.h \
$$PWD/qqmltypemodule_p.h \
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 5b22d8c6ed..90c2c1fb96 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -55,7 +55,6 @@
#include <private/qqmlengine_p.h>
#include <private/qfieldlist_p.h>
#include <private/qqmltypemodule_p.h>
-#include <private/qqmlmetatyperegistrationfailurerecorder_p.h>
#include <QtCore/qjsonobject.h>
#include <QtCore/qjsonarray.h>
@@ -133,85 +132,6 @@ bool isPathAbsolute(const QString &path)
#endif
}
-/*
- \internal
-
- Fetches the QQmlType instance registered for \a urlString, creating a
- registration for it if it is not already registered, using the associated
- \a typeName, \a isCompositeSingleton, \a majorVersion and \a minorVersion
- details.
-
- Errors (if there are any) are placed into \a errors, if it is nonzero. Note
- that errors are treated as fatal if \a errors is not set.
-*/
-QQmlType fetchOrCreateTypeForUrl(const QString &urlString, const QHashedStringRef& typeName,
- bool isCompositeSingleton, QList<QQmlError> *errors,
- int majorVersion=-1, int minorVersion=-1)
-{
- QUrl url(urlString); // ### unfortunate (costly) conversion
- QQmlType ret = QQmlMetaType::qmlType(url);
- if (ret.isValid())
- return ret;
-
- int dot = typeName.indexOf(QLatin1Char('.'));
- QHashedStringRef unqualifiedtype = dot < 0 ? typeName : QHashedStringRef(typeName.constData() + dot + 1, typeName.length() - dot - 1);
-
- // We need a pointer, but we were passed a string. Take a copy so we
- // can guarentee it will live long enough to reach qmlregister.
- QByteArray buf(unqualifiedtype.toString().toUtf8());
-
- QQmlMetaTypeRegistrationFailureRecorder failureRecorder;
-
- // Register the type. Note that the URI parameters here are empty; for
- // file type imports, we do not place them in a URI as we don't
- // necessarily have a good and unique one (picture a library import,
- // which may be found in multiple plugin locations on disk), but there
- // are other reasons for this too.
- //
- // By not putting them in a URI, we prevent the types from being
- // registered on a QQmlTypeModule; this is important, as once types are
- // placed on there, they cannot be easily removed, meaning if the
- // developer subsequently loads a different import (meaning different
- // types) with the same URI (using, say, a different plugin path), it is
- // very undesirable that we continue to associate the types from the
- // "old" URI with that new module.
- //
- // Not having URIs also means that the types cannot be found by name
- // etc, the only way to look them up is through QQmlImports -- for
- // better or worse.
- if (isCompositeSingleton) {
- QQmlPrivate::RegisterCompositeSingletonType reg = {
- url,
- "", // uri
- majorVersion,
- minorVersion,
- buf.constData()
- };
- ret = QQmlMetaType::registerCompositeSingletonType(reg);
- } else {
- QQmlPrivate::RegisterCompositeType reg = {
- url,
- "", // uri
- majorVersion,
- minorVersion,
- buf.constData()
- };
- ret = QQmlMetaType::registerCompositeType(reg);
- }
-
- // This means that the type couldn't be found by URL, but could not be
- // registered either, meaning we most likely were passed some kind of bad
- // data.
- if (!ret.isValid()) {
- if (!errors) // Cannot list errors properly, just quit
- qFatal("%s", failureRecorder.failures().join('\n').toLatin1().constData());
- QQmlError error;
- error.setDescription(failureRecorder.failures().join('\n'));
- errors->prepend(error);
- }
- return ret;
-}
-
} // namespace
struct RegisteredPlugin {
@@ -822,9 +742,9 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt
if (candidate != end) {
if (!base) // ensure we have a componentUrl
componentUrl = resolveLocalUrl(QString(url + candidate->typeName + dotqml_string), candidate->fileName);
- QQmlType returnType = fetchOrCreateTypeForUrl(componentUrl, type, isCompositeSingleton,
- nullptr, candidate->majorVersion,
- candidate->minorVersion);
+ QQmlType returnType = QQmlMetaType::typeForUrl(componentUrl, type, isCompositeSingleton,
+ nullptr, candidate->majorVersion,
+ candidate->minorVersion);
if (vmajor)
*vmajor = candidate->majorVersion;
if (vminor)
@@ -868,8 +788,8 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt
if (typeRecursionDetected)
*typeRecursionDetected = true;
} else {
- QQmlType returnType = fetchOrCreateTypeForUrl(
- qmlUrl, type, registrationType == QQmlType::CompositeSingletonType, nullptr);
+ QQmlType returnType = QQmlMetaType::typeForUrl(
+ qmlUrl, type, registrationType == QQmlType::CompositeSingletonType, nullptr);
if (type_return)
*type_return = returnType;
return returnType.isValid();
@@ -917,7 +837,10 @@ bool QQmlImportsPrivate::resolveType(const QHashedStringRef& type, int *vmajor,
return true;
if (s->imports.count() == 1 && !s->imports.at(0)->isLibrary && type_return && s != &unqualifiedset) {
// qualified, and only 1 url
- *type_return = fetchOrCreateTypeForUrl(resolveLocalUrl(s->imports.at(0)->url, unqualifiedtype.toString() + QLatin1String(".qml")), type, false, errors);
+ *type_return = QQmlMetaType::typeForUrl(
+ resolveLocalUrl(s->imports.at(0)->url,
+ unqualifiedtype.toString() + QLatin1String(".qml")),
+ type, false, errors);
return type_return->isValid();
}
}
@@ -2035,77 +1958,7 @@ bool QQmlImportDatabase::registerPluginTypes(QObject *instance, const QString &b
{
if (qmlImportTrace())
qDebug().nospace() << "QQmlImportDatabase::registerPluginTypes: " << uri << " from " << basePath;
-
- QQmlTypesExtensionInterface *iface = qobject_cast<QQmlTypesExtensionInterface *>(instance);
- if (!iface) {
- if (errors) {
- QQmlError error;
- error.setDescription(tr("Module loaded for URI '%1' does not implement QQmlTypesExtensionInterface").arg(typeNamespace));
- errors->prepend(error);
- }
- return false;
- }
-
- const QByteArray bytes = uri.toUtf8();
- const char *moduleId = bytes.constData();
-
- QQmlMetaTypeRegistrationFailureRecorder failureRecorder;
- {
- // Create a scope for QWriteLocker to keep it as narrow as possible, and
- // to ensure that we release it before the call to initalizeEngine below
- QMutexLocker lock(QQmlMetaType::typeRegistrationLock());
-
- if (!typeNamespace.isEmpty()) {
- // This is an 'identified' module
- if (typeNamespace != uri) {
- // The namespace for type registrations must match the URI for locating the module
- if (errors) {
- QQmlError error;
- error.setDescription(tr("Module namespace '%1' does not match import URI '%2'").arg(typeNamespace).arg(uri));
- errors->prepend(error);
- }
- return false;
- }
-
- if (QQmlMetaType::namespaceContainsRegistrations(typeNamespace, vmaj)) {
- // Other modules have already installed to this namespace
- if (errors) {
- QQmlError error;
- error.setDescription(tr("Namespace '%1' has already been used for type registration").arg(typeNamespace));
- errors->prepend(error);
- }
- return false;
- } else {
- QQmlMetaType::protectNamespace(typeNamespace);
- }
- } else {
- // This is not an identified module - provide a warning
- qWarning().nospace() << qPrintable(tr("Module '%1' does not contain a module identifier directive - it cannot be protected from external registrations.").arg(uri));
- }
-
- QQmlMetaType::setTypeRegistrationNamespace(typeNamespace);
-
- if (QQmlExtensionPlugin *plugin = qobject_cast<QQmlExtensionPlugin *>(instance)) {
- // basepath should point to the directory of the module, not the plugin file itself:
- QQmlExtensionPluginPrivate::get(plugin)->baseUrl = QQmlImports::urlFromLocalFileOrQrcOrUrl(basePath);
- }
-
- iface->registerTypes(moduleId);
- QQmlMetaType::setTypeRegistrationNamespace(QString());
- } // QWriteLocker lock(QQmlMetaType::typeRegistrationLock())
-
- if (!failureRecorder.failures().isEmpty()) {
- if (errors) {
- for (const QString &failure : failureRecorder.failures()) {
- QQmlError error;
- error.setDescription(failure);
- errors->prepend(error);
- }
- }
- return false;
- }
-
- return true;
+ return QQmlMetaType::registerPluginTypes(instance, basePath, uri, typeNamespace, vmaj, errors);
}
/*!
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 8c3717844c..f7b5ee8bf0 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -43,6 +43,7 @@
#include <private/qqmltypemodule_p_p.h>
#include <private/qqmltype_p_p.h>
#include <private/qqmltypeloader_p.h>
+#include <private/qqmlextensionplugin_p.h>
#include <QtCore/qcoreapplication.h>
#include <QtCore/qmutex.h>
@@ -483,29 +484,203 @@ void QQmlMetaType::registerUndeletableType(const QQmlType &dtype)
data->undeletableTypes.insert(dtype);
}
-bool QQmlMetaType::namespaceContainsRegistrations(const QString &uri, int majorVersion)
+static bool namespaceContainsRegistrations(const QQmlMetaTypeData *data, const QString &uri,
+ int majorVersion)
{
- const QQmlMetaTypeDataPtr data;
-
// Has any type previously been installed to this namespace?
QHashedString nameSpace(uri);
- for (const QQmlType &type : data->types)
+ for (const QQmlType &type : data->types) {
if (type.module() == nameSpace && type.majorVersion() == majorVersion)
return true;
+ }
return false;
}
-void QQmlMetaType::protectNamespace(const QString &uri)
+class QQmlMetaTypeRegistrationFailureRecorder
{
+ Q_DISABLE_COPY_MOVE(QQmlMetaTypeRegistrationFailureRecorder)
+public:
+ QQmlMetaTypeRegistrationFailureRecorder(QQmlMetaTypeData *data, QStringList *failures)
+ : data(data)
+ {
+ data->setTypeRegistrationFailures(failures);
+ }
+
+ ~QQmlMetaTypeRegistrationFailureRecorder()
+ {
+ data->setTypeRegistrationFailures(nullptr);
+ }
+
+ QQmlMetaTypeData *data = nullptr;
+};
+
+
+bool QQmlMetaType::registerPluginTypes(QObject *instance, const QString &basePath,
+ const QString &uri, const QString &typeNamespace, int vmaj,
+ QList<QQmlError> *errors)
+{
+ QQmlTypesExtensionInterface *iface = qobject_cast<QQmlTypesExtensionInterface *>(instance);
+ if (!iface) {
+ if (errors) {
+ QQmlError error;
+ error.setDescription(QStringLiteral("Module loaded for URI '%1' does not implement "
+ "QQmlTypesExtensionInterface").arg(typeNamespace));
+ errors->prepend(error);
+ }
+ return false;
+ }
+
+ if (!typeNamespace.isEmpty() && typeNamespace != uri) {
+ // This is an 'identified' module
+ // The namespace for type registrations must match the URI for locating the module
+ if (errors) {
+ QQmlError error;
+ error.setDescription(
+ QStringLiteral("Module namespace '%1' does not match import URI '%2'")
+ .arg(typeNamespace).arg(uri));
+ errors->prepend(error);
+ }
+ return false;
+ }
+
+ QStringList failures;
QQmlMetaTypeDataPtr data;
- data->protectedNamespaces.insert(uri);
+ {
+ QQmlMetaTypeRegistrationFailureRecorder failureRecorder(data, &failures);
+ if (!typeNamespace.isEmpty()) {
+ // This is an 'identified' module
+ if (namespaceContainsRegistrations(data, typeNamespace, vmaj)) {
+ // Other modules have already installed to this namespace
+ if (errors) {
+ QQmlError error;
+ error.setDescription(QStringLiteral("Namespace '%1' has already been used "
+ "for type registration")
+ .arg(typeNamespace));
+ errors->prepend(error);
+ }
+ return false;
+ }
+
+ data->protectedNamespaces.insert(uri);
+ } else {
+ // This is not an identified module - provide a warning
+ qWarning().nospace() << qPrintable(
+ QStringLiteral("Module '%1' does not contain a module identifier directive - "
+ "it cannot be protected from external registrations.").arg(uri));
+ }
+
+ if (auto *plugin = qobject_cast<QQmlExtensionPlugin *>(instance)) {
+ // basepath should point to the directory of the module, not the plugin file itself:
+ QQmlExtensionPluginPrivate::get(plugin)->baseUrl
+ = QQmlImports::urlFromLocalFileOrQrcOrUrl(basePath);
+ }
+
+ data->typeRegistrationNamespace = typeNamespace;
+ const QByteArray bytes = uri.toUtf8();
+ const char *moduleId = bytes.constData();
+ iface->registerTypes(moduleId);
+ data->typeRegistrationNamespace.clear();
+ }
+
+ if (!failures.isEmpty()) {
+ if (errors) {
+ for (const QString &failure : qAsConst(failures)) {
+ QQmlError error;
+ error.setDescription(failure);
+ errors->prepend(error);
+ }
+ }
+ return false;
+ }
+
+ return true;
}
-void QQmlMetaType::setTypeRegistrationNamespace(const QString &uri)
+/*
+ \internal
+
+ Fetches the QQmlType instance registered for \a urlString, creating a
+ registration for it if it is not already registered, using the associated
+ \a typeName, \a isCompositeSingleton, \a majorVersion and \a minorVersion
+ details.
+
+ Errors (if there are any) are placed into \a errors, if it is nonzero.
+ Otherwise errors are printed as warnings.
+*/
+QQmlType QQmlMetaType::typeForUrl(const QString &urlString,
+ const QHashedStringRef &qualifiedType,
+ bool isCompositeSingleton, QList<QQmlError> *errors,
+ int majorVersion, int minorVersion)
{
+ // ### unfortunate (costly) conversion
+ const QUrl url = QQmlTypeLoader::normalize(QUrl(urlString));
+
QQmlMetaTypeDataPtr data;
- data->typeRegistrationNamespace = uri;
+ QQmlType ret(data->urlToType.value(url));
+ if (ret.isValid() && ret.sourceUrl() == url)
+ return ret;
+
+ const int dot = qualifiedType.indexOf(QLatin1Char('.'));
+ const QString typeName = dot < 0
+ ? qualifiedType.toString()
+ : QString(qualifiedType.constData() + dot + 1, qualifiedType.length() - dot - 1);
+
+ QStringList failures;
+ QQmlMetaTypeRegistrationFailureRecorder failureRecorder(data, &failures);
+
+ // Register the type. Note that the URI parameters here are empty; for
+ // file type imports, we do not place them in a URI as we don't
+ // necessarily have a good and unique one (picture a library import,
+ // which may be found in multiple plugin locations on disk), but there
+ // are other reasons for this too.
+ //
+ // By not putting them in a URI, we prevent the types from being
+ // registered on a QQmlTypeModule; this is important, as once types are
+ // placed on there, they cannot be easily removed, meaning if the
+ // developer subsequently loads a different import (meaning different
+ // types) with the same URI (using, say, a different plugin path), it is
+ // very undesirable that we continue to associate the types from the
+ // "old" URI with that new module.
+ //
+ // Not having URIs also means that the types cannot be found by name
+ // etc, the only way to look them up is through QQmlImports -- for
+ // better or worse.
+ const QQmlType::RegistrationType registrationType = isCompositeSingleton
+ ? QQmlType::CompositeSingletonType
+ : QQmlType::CompositeType;
+ if (checkRegistration(registrationType, data, nullptr, typeName, majorVersion)) {
+ auto *priv = new QQmlTypePrivate(registrationType);
+ priv->elementName = typeName;
+ priv->version_maj = majorVersion;
+ priv->version_min = minorVersion;
+
+ if (isCompositeSingleton) {
+ priv->extraData.sd->singletonInstanceInfo = new QQmlType::SingletonInstanceInfo;
+ priv->extraData.sd->singletonInstanceInfo->url = url;
+ priv->extraData.sd->singletonInstanceInfo->typeName = typeName;
+ } else {
+ priv->extraData.fd->url = url;
+ }
+
+ data->registerType(priv);
+ priv->refCount.deref();
+ addTypeToData(priv, data);
+ data->urlToType.insertMulti(url, priv);
+ return QQmlType(priv);
+ }
+
+ // This means that the type couldn't be found by URL, but could not be
+ // registered either, meaning we most likely were passed some kind of bad
+ // data.
+ if (errors) {
+ QQmlError error;
+ error.setDescription(failures.join('\n'));
+ errors->prepend(error);
+ } else {
+ qWarning("%s", failures.join('\n').toLatin1().constData());
+ }
+ return QQmlType();
}
QMutex *QQmlMetaType::typeRegistrationLock()
@@ -1094,18 +1269,6 @@ QString QQmlMetaType::prettyTypeName(const QObject *object)
return typeName;
}
-void QQmlMetaType::startRecordingTypeRegFailures(QStringList *failures)
-{
- QQmlMetaTypeDataPtr data;
- data->startRecordingTypeRegFailures(failures);
-}
-
-void QQmlMetaType::stopRecordingTypeRegFailures()
-{
- QQmlMetaTypeDataPtr data;
- data->stopRecordingTypeRegFailures();
-}
-
QList<QQmlProxyMetaObject::ProxyData> QQmlMetaType::proxyData(const QMetaObject *mo,
const QMetaObject *baseMetaObject,
QMetaObject *lastMetaObject)
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 5ba13ff4ee..2d22eb519f 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -59,6 +59,7 @@ QT_BEGIN_NAMESPACE
class QQmlTypeModule;
class QMutex;
+class QQmlError;
class Q_QML_PRIVATE_EXPORT QQmlMetaType
{
@@ -68,6 +69,12 @@ public:
static QQmlType registerSingletonType(const QQmlPrivate::RegisterSingletonType &type);
static QQmlType registerCompositeSingletonType(const QQmlPrivate::RegisterCompositeSingletonType &type);
static QQmlType registerCompositeType(const QQmlPrivate::RegisterCompositeType &type);
+ static bool registerPluginTypes(QObject *instance, const QString &basePath,
+ const QString &uri, const QString &typeNamespace, int vmaj,
+ QList<QQmlError> *errors);
+ static QQmlType typeForUrl(const QString &urlString, const QHashedStringRef& typeName,
+ bool isCompositeSingleton, QList<QQmlError> *errors,
+ int majorVersion = -1, int minorVersion = -1);
static void unregisterType(int type);
@@ -145,12 +152,6 @@ public:
static void prependCachedUnitLookupFunction(QQmlPrivate::QmlUnitCacheLookupFunction handler);
static void removeCachedUnitLookupFunction(QQmlPrivate::QmlUnitCacheLookupFunction handler);
- static bool namespaceContainsRegistrations(const QString &, int majorVersion);
-
- static void protectNamespace(const QString &);
-
- static void setTypeRegistrationNamespace(const QString &);
-
static QMutex *typeRegistrationLock();
static QString prettyTypeName(const QObject *object);
@@ -171,9 +172,6 @@ public:
static int registerUnitCacheHook(const QQmlPrivate::RegisterQmlUnitCacheHook &hookRegistration);
static void clearTypeRegistrations();
- static void startRecordingTypeRegFailures(QStringList *failures);
- static void stopRecordingTypeRegFailures();
-
static QList<QQmlProxyMetaObject::ProxyData> proxyData(const QMetaObject *mo,
const QMetaObject *baseMetaObject,
QMetaObject *lastMetaObject);
diff --git a/src/qml/qml/qqmlmetatypedata_p.h b/src/qml/qml/qqmlmetatypedata_p.h
index 17409ed51d..cde6294c37 100644
--- a/src/qml/qml/qqmlmetatypedata_p.h
+++ b/src/qml/qml/qqmlmetatypedata_p.h
@@ -115,20 +115,21 @@ struct QQmlMetaTypeData
QQmlPropertyCache *propertyCache(const QMetaObject *metaObject);
QQmlPropertyCache *propertyCache(const QQmlType &type, int minorVersion);
- void startRecordingTypeRegFailures(QStringList *storage)
- { typeRegistrationFailures = storage; }
- void stopRecordingTypeRegFailures()
- { startRecordingTypeRegFailures(nullptr); }
+ void setTypeRegistrationFailures(QStringList *failures)
+ {
+ m_typeRegistrationFailures = failures;
+ }
+
void recordTypeRegFailure(const QString &message)
{
- if (typeRegistrationFailures)
- typeRegistrationFailures->append(message);
+ if (m_typeRegistrationFailures)
+ m_typeRegistrationFailures->append(message);
else
qWarning("%s", message.toUtf8().constData());
}
private:
- QStringList *typeRegistrationFailures = nullptr;
+ QStringList *m_typeRegistrationFailures = nullptr;
};
inline uint qHash(const QQmlMetaTypeData::VersionedUri &v)
diff --git a/src/qml/qml/qqmlmetatyperegistrationfailurerecorder.cpp b/src/qml/qml/qqmlmetatyperegistrationfailurerecorder.cpp
deleted file mode 100644
index ed11891863..0000000000
--- a/src/qml/qml/qqmlmetatyperegistrationfailurerecorder.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qqmlmetatyperegistrationfailurerecorder_p.h"
-
-#include <private/qqmlmetatype_p.h>
-#include <private/qqmlmetatypedata_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QQmlMetaTypeRegistrationFailureRecorder::QQmlMetaTypeRegistrationFailureRecorder()
-{
- QQmlMetaType::startRecordingTypeRegFailures(&_failures);
-}
-
-QQmlMetaTypeRegistrationFailureRecorder::~QQmlMetaTypeRegistrationFailureRecorder()
-{
- QQmlMetaType::stopRecordingTypeRegFailures();
-}
-
-QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlmetatyperegistrationfailurerecorder_p.h b/src/qml/qml/qqmlmetatyperegistrationfailurerecorder_p.h
deleted file mode 100644
index a5cfdeaa60..0000000000
--- a/src/qml/qml/qqmlmetatyperegistrationfailurerecorder_p.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQMLMETATYPEREGISTRATIONFAILURERECORDER_P_H
-#define QQMLMETATYPEREGISTRATIONFAILURERECORDER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qstringlist.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_AUTOTEST_EXPORT QQmlMetaTypeRegistrationFailureRecorder
-{
- QStringList _failures;
-
-public:
- QQmlMetaTypeRegistrationFailureRecorder();
- ~QQmlMetaTypeRegistrationFailureRecorder();
-
- QStringList failures() const
- { return _failures; }
-};
-
-QT_END_NAMESPACE
-
-#endif // QQMLMETATYPEREGISTRATIONFAILURERECORDER_P_H