1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <private/qtqmlglobal_p.h>
5#include <qqmlmoduleregistration.h>
6#include <qqml.h>
7
8QT_BEGIN_NAMESPACE
9
10// Provide the type registration for QtQml here, in libQtQml.so.
11// This way we get a completely functional QtQml module and don't have to
12// rely on the plugin to be loaded.
13// In CMakeLists.txt we've specified NO_GENERATE_QMLTYPES to prevent
14// the generation of an extra type registration file.
15Q_QML_PRIVATE_EXPORT void qml_register_types_QtQml()
16{
17 // ### Qt7: Handle version 6 like version 2.
18 qmlRegisterModule(uri: "QtQml", versionMajor: 2, versionMinor: 0);
19 qmlRegisterModule(uri: "QtQml", versionMajor: 2, versionMinor: 254);
20 qmlRegisterModule(uri: "QtQml", QT_VERSION_MAJOR, versionMinor: 0);
21 qmlRegisterModule(uri: "QtQml", QT_VERSION_MAJOR, QT_VERSION_MINOR);
22}
23
24static const QQmlModuleRegistration registration("QtQml", qml_register_types_QtQml);
25
26QT_END_NAMESPACE
27

source code of qtdeclarative/src/qml/qml/qqmlmetamoduleregistration.cpp