aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-07-22 09:56:51 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-07-22 17:21:53 +0200
commit487d22bcde7e9d06162d44e7c5dca31d3afac694 (patch)
tree42c375cc436b86d89a3b807e96a60b71314c42ad
parentaf3438cf29925bfcf4ff1a8fa04276580b66ce37 (diff)
Remove module registration related Qt version #ifdefs
Ahead of compiling declarative with a newer qtbase that bumps the Qt version to 6, we can already now remove the Qt 5 code paths related to type registrations as commit 8534634bd204ccdca3edcc244a35be6e81739fce implements those dependencies differently. This also required lowering the minimum minor version for the Instantiator to 1, as it was in the Qt 5 branch. Change-Id: Idd38c967eeb8423509237116803d292bba422f8b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/imports/qtqml/plugin.cpp8
-rw-r--r--src/imports/qtquick2/plugin.cpp15
-rw-r--r--src/qml/qml/qqmlengine.cpp24
-rw-r--r--src/qml/qml/qqmlengine_p.h3
-rw-r--r--src/qmlmodels/qqmlmodelsmodule.cpp35
-rw-r--r--src/qmlmodels/qqmlmodelsmodule_p.h5
-rw-r--r--src/qmlworkerscript/qqmlworkerscriptmodule.cpp11
-rw-r--r--src/qmlworkerscript/qqmlworkerscriptmodule_p.h3
8 files changed, 0 insertions, 104 deletions
diff --git a/src/imports/qtqml/plugin.cpp b/src/imports/qtqml/plugin.cpp
index 04cc2cc082..f63e04c3b9 100644
--- a/src/imports/qtqml/plugin.cpp
+++ b/src/imports/qtqml/plugin.cpp
@@ -42,10 +42,6 @@
#include <QtQml/private/qqmlcomponentattached_p.h>
#include <QtQml/private/qqmlbind_p.h>
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-#include <QtQmlModels/private/qqmlmodelsmodule_p.h>
-#endif
-
QT_BEGIN_NAMESPACE
/*!
@@ -76,10 +72,6 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml"));
QQmlEnginePrivate::defineModule();
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QQmlModelsModule::registerQmlTypes();
-#endif
-
qmlRegisterModule(uri, 2, 15);
}
};
diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp
index 6c9d08e379..1b14e9f0e5 100644
--- a/src/imports/qtquick2/plugin.cpp
+++ b/src/imports/qtquick2/plugin.cpp
@@ -40,14 +40,6 @@
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/QQmlEngine>
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-#include <QtQml/private/qqmlengine_p.h>
-#include <QtQmlModels/private/qqmlmodelsmodule_p.h>
-#if QT_CONFIG(qml_worker_script)
-#include <QtQmlWorkerScript/private/qqmlworkerscriptmodule_p.h>
-#endif
-#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-
#include <private/qtquick2_p.h>
QT_BEGIN_NAMESPACE
@@ -64,13 +56,6 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick"));
Q_UNUSED(uri);
moduleDefined = true;
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QQmlEnginePrivate::registerQuickTypes();
- QQmlModelsModule::registerQuickTypes();
-#if QT_CONFIG(qml_worker_script)
- QQmlWorkerScriptModule::registerQuickTypes();
-#endif
-#endif
QQmlQtQuick2Module::defineModule();
qmlRegisterModule("QtQuick", 2, 15);
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 00d2a6b502..43c312812c 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -220,30 +220,6 @@ void QQmlEnginePrivate::defineModule()
#endif
}
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-void QQmlEnginePrivate::registerQuickTypes()
-{
- // Don't add anything here. These are only for backwards compatibility.
-
- const char uri[] = "QtQuick";
-
- qmlRegisterType<QQmlComponent>(uri, 2, 0, "Component");
- qmlRegisterType<QObject>(uri, 2, 0, "QtObject");
- qmlRegisterType<QQmlBind>(uri, 2, 0, "Binding");
- qmlRegisterType<QQmlBind, 8>(uri, 2, 8, "Binding");
- qmlRegisterCustomType<QQmlConnections>(uri, 2, 0, "Connections", new QQmlConnectionsParser);
- qmlRegisterCustomType<QQmlConnections, 1>(uri, 2, 7, "Connections", new QQmlConnectionsParser);
-#if QT_CONFIG(qml_animation)
- qmlRegisterType<QQmlTimer>(uri, 2, 0,"Timer");
-#endif
- qmlRegisterType<QQmlLoggingCategory>(uri, 2, 8, "LoggingCategory");
- qmlRegisterType<QQmlLoggingCategory, 1>(uri, 2, 12, "LoggingCategory");
-#if QT_CONFIG(qml_locale)
- qmlRegisterUncreatableType<QQmlLocale>(uri, 2, 0, "Locale", QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()"));
-#endif
-}
-#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-
bool QQmlEnginePrivate::designerMode()
{
return s_designerMode;
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index 385ae02ce5..2c4bb36c8f 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -252,9 +252,6 @@ public:
static QList<QQmlError> qmlErrorFromDiagnostics(const QString &fileName, const QList<QQmlJS::DiagnosticMessage> &diagnosticMessages);
static void defineModule();
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- static void registerQuickTypes();
-#endif
static bool designerMode();
static void activateDesignerMode();
diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp
index 27f5623b8c..5195f9baad 100644
--- a/src/qmlmodels/qqmlmodelsmodule.cpp
+++ b/src/qmlmodels/qqmlmodelsmodule.cpp
@@ -62,41 +62,6 @@
QT_BEGIN_NAMESPACE
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-
-void QQmlModelsModule::registerQmlTypes()
-{
- // Don't add anything here. These are only for backwards compatibility.
-#if QT_CONFIG(qml_object_model)
- qmlRegisterType<QQmlInstantiator>("QtQml", 2, 1, "Instantiator"); // Only available in >= 2.1
- qmlRegisterType<QQmlInstanceModel>();
-#endif
-}
-
-void QQmlModelsModule::registerQuickTypes()
-{
- // Don't add anything here. These are only for backwards compatibility.
-
- const char uri[] = "QtQuick";
-
-#if QT_CONFIG(qml_object_model)
- qmlRegisterType<QQmlInstantiator>(uri, 2, 1, "Instantiator");
- qmlRegisterType<QQmlInstanceModel>();
- qmlRegisterType<QQmlObjectModel>(uri, 2, 0, "VisualItemModel");
-#endif
-#if QT_CONFIG(qml_list_model)
- qmlRegisterType<QQmlListElement>(uri, 2, 0, "ListElement");
- qmlRegisterCustomType<QQmlListModel>(uri, 2, 0, "ListModel", new QQmlListModelParser);
-#endif
-#if QT_CONFIG(qml_delegate_model)
- qmlRegisterType<QQmlDelegateModel>(uri, 2, 0, "VisualDataModel");
- qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 0, "VisualDataGroup");
- qmlRegisterType<QQuickPackage>(uri, 2, 0, "Package");
-#endif
-}
-
-#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-
void QQmlModelsModule::defineModule()
{
const char uri[] = "QtQml.Models";
diff --git a/src/qmlmodels/qqmlmodelsmodule_p.h b/src/qmlmodels/qqmlmodelsmodule_p.h
index 7e02578db9..f63052b682 100644
--- a/src/qmlmodels/qqmlmodelsmodule_p.h
+++ b/src/qmlmodels/qqmlmodelsmodule_p.h
@@ -58,11 +58,6 @@ QT_BEGIN_NAMESPACE
class Q_QMLMODELS_PRIVATE_EXPORT QQmlModelsModule
{
public:
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- static void registerQmlTypes();
- static void registerQuickTypes();
-#endif
-
static void defineModule();
static void defineLabsModule();
};
diff --git a/src/qmlworkerscript/qqmlworkerscriptmodule.cpp b/src/qmlworkerscript/qqmlworkerscriptmodule.cpp
index 98e82dbeba..5eb7d306bc 100644
--- a/src/qmlworkerscript/qqmlworkerscriptmodule.cpp
+++ b/src/qmlworkerscript/qqmlworkerscriptmodule.cpp
@@ -42,17 +42,6 @@
QT_BEGIN_NAMESPACE
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-
-void QQmlWorkerScriptModule::registerQuickTypes()
-{
- // Don't add anything here. These are only for backwards compatibility.
- const char uri[] = "QtQuick";
- qmlRegisterType<QQuickWorkerScript>(uri, 2, 0, "WorkerScript");
-}
-
-#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-
void QQmlWorkerScriptModule::defineModule()
{
const char uri[] = "QtQml.WorkerScript";
diff --git a/src/qmlworkerscript/qqmlworkerscriptmodule_p.h b/src/qmlworkerscript/qqmlworkerscriptmodule_p.h
index a2efb304c1..ae52d10c16 100644
--- a/src/qmlworkerscript/qqmlworkerscriptmodule_p.h
+++ b/src/qmlworkerscript/qqmlworkerscriptmodule_p.h
@@ -58,9 +58,6 @@ QT_BEGIN_NAMESPACE
class Q_QMLWORKERSCRIPT_PRIVATE_EXPORT QQmlWorkerScriptModule
{
public:
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- static void registerQuickTypes();
-#endif
static void defineModule();
};