diff options
Diffstat (limited to 'src/imports/qtqml')
-rw-r--r-- | src/imports/qtqml/dependencies.json | 2 | ||||
-rw-r--r-- | src/imports/qtqml/plugin.cpp | 91 | ||||
-rw-r--r-- | src/imports/qtqml/plugins.qmltypes | 48 | ||||
-rw-r--r-- | src/imports/qtqml/qmldir | 2 | ||||
-rw-r--r-- | src/imports/qtqml/qtqml.pro | 16 |
5 files changed, 127 insertions, 32 deletions
diff --git a/src/imports/qtqml/dependencies.json b/src/imports/qtqml/dependencies.json new file mode 100644 index 0000000000..0d4f101c7a --- /dev/null +++ b/src/imports/qtqml/dependencies.json @@ -0,0 +1,2 @@ +[ +] diff --git a/src/imports/qtqml/plugin.cpp b/src/imports/qtqml/plugin.cpp new file mode 100644 index 0000000000..7595d6d65b --- /dev/null +++ b/src/imports/qtqml/plugin.cpp @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the plugins 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 <QtQml/qqmlextensionplugin.h> +#include <QtQml/private/qqmlengine_p.h> +#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 + +/*! + \qmlmodule QtQml 2.\QtMinorVersion + \title Qt QML Base Types + \ingroup qmlmodules + \brief Provides basic QML types + \since 5.0 + + This QML module contains basic QML types. + + To use the types in this module, import the module with the following line: + + \qml \QtMinorVersion + import QtQml 2.\1 + \endqml +*/ + +//![class decl] +class QtQmlPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) +public: + QtQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } + void registerTypes(const char *uri) override + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml")); + QQmlEnginePrivate::defineModule(); + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QQmlModelsModule::registerQmlTypes(); +#endif + + // Auto-increment the import to stay in sync with ALL future QtQml minor versions from 5.11 onward + qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + } +}; +//![class decl] + +QT_END_NAMESPACE + +#include "plugin.moc" diff --git a/src/imports/qtqml/plugins.qmltypes b/src/imports/qtqml/plugins.qmltypes index d548a78dd0..7bccfea26a 100644 --- a/src/imports/qtqml/plugins.qmltypes +++ b/src/imports/qtqml/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -noforceqtquick QtQml 2.13' +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQml 2.14' Module { dependencies: [] @@ -27,19 +27,33 @@ Module { Component { name: "QQmlBind" prototype: "QObject" - exports: ["QtQml/Binding 2.0", "QtQml/Binding 2.8"] - exportMetaObjectRevisions: [0, 8] + exports: [ + "QtQml/Binding 2.0", + "QtQml/Binding 2.14", + "QtQml/Binding 2.8" + ] + exportMetaObjectRevisions: [0, 14, 8] + Enum { + name: "RestorationMode" + values: { + "RestoreNone": 0, + "RestoreBinding": 1, + "RestoreValue": 2, + "RestoreBindingOrValue": 3 + } + } Property { name: "target"; type: "QObject"; isPointer: true } Property { name: "property"; type: "string" } Property { name: "value"; type: "QVariant" } Property { name: "when"; type: "bool" } Property { name: "delayed"; revision: 8; type: "bool" } + Property { name: "restoreMode"; revision: 14; type: "RestorationMode" } } Component { name: "QQmlComponent" prototype: "QObject" - exports: ["QML/Component 1.0", "QtQml/Component 2.0"] - exportMetaObjectRevisions: [0, 0] + exports: ["QtQml/Component 2.0"] + exportMetaObjectRevisions: [0] attachedType: "QQmlComponentAttached" Enum { name: "CompilationMode" @@ -94,11 +108,11 @@ Module { name: "QQmlConnections" prototype: "QObject" exports: ["QtQml/Connections 2.0", "QtQml/Connections 2.3"] - exportMetaObjectRevisions: [0, 1] + exportMetaObjectRevisions: [0, 3] Property { name: "target"; type: "QObject"; isPointer: true } - Property { name: "enabled"; revision: 1; type: "bool" } + Property { name: "enabled"; revision: 3; type: "bool" } Property { name: "ignoreUnknownSignals"; type: "bool" } - Signal { name: "enabledChanged"; revision: 1 } + Signal { name: "enabledChanged"; revision: 3 } } Component { name: "QQmlInstanceModel" @@ -199,7 +213,7 @@ Module { name: "QQmlLoggingCategory" prototype: "QObject" exports: ["QtQml/LoggingCategory 2.12", "QtQml/LoggingCategory 2.8"] - exportMetaObjectRevisions: [1, 0] + exportMetaObjectRevisions: [12, 0] Enum { name: "DefaultLogLevel" values: { @@ -211,7 +225,7 @@ Module { } } Property { name: "name"; type: "string" } - Property { name: "defaultLogLevel"; revision: 1; type: "DefaultLogLevel" } + Property { name: "defaultLogLevel"; revision: 12; type: "DefaultLogLevel" } } Component { name: "QQmlTimer" @@ -228,18 +242,4 @@ Module { Method { name: "stop" } Method { name: "restart" } } - Component { - name: "QQuickMouseEvent" - prototype: "QObject" - Property { name: "x"; type: "double"; isReadonly: true } - Property { name: "y"; type: "double"; isReadonly: true } - Property { name: "button"; type: "int"; isReadonly: true } - Property { name: "buttons"; type: "int"; isReadonly: true } - Property { name: "modifiers"; type: "int"; isReadonly: true } - Property { name: "source"; revision: 7; type: "int"; isReadonly: true } - Property { name: "wasHeld"; type: "bool"; isReadonly: true } - Property { name: "isClick"; type: "bool"; isReadonly: true } - Property { name: "accepted"; type: "bool" } - Property { name: "flags"; revision: 11; type: "int"; isReadonly: true } - } } diff --git a/src/imports/qtqml/qmldir b/src/imports/qtqml/qmldir index 8175ebb1a1..f6b51c7970 100644 --- a/src/imports/qtqml/qmldir +++ b/src/imports/qtqml/qmldir @@ -1,2 +1,4 @@ module QtQml +plugin qmlplugin +classname QtQmlPlugin typeinfo plugins.qmltypes diff --git a/src/imports/qtqml/qtqml.pro b/src/imports/qtqml/qtqml.pro index c00172ddc4..7a5169b8fc 100644 --- a/src/imports/qtqml/qtqml.pro +++ b/src/imports/qtqml/qtqml.pro @@ -1,12 +1,12 @@ TARGETPATH = QtQml -AUX_QML_FILES += plugins.qmltypes +CXX_MODULE = qml +TARGET = qmlplugin +IMPORT_VERSION = 2.$$QT_MINOR_VERSION -load(qml_module) +SOURCES += \ + plugin.cpp -# qmltypes target -!cross_compile:if(build_pass|!debug_and_release) { - qtPrepareTool(QMLPLUGINDUMP, qmlplugindump) +# In Qt6 we won't need qmlmodels-private here +QT = qml-private qmlmodels-private - qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable -noforceqtquick QtQml 2.$$QT_MINOR_VERSION > $$PWD/plugins.qmltypes - QMAKE_EXTRA_TARGETS += qmltypes -} +load(qml_plugin) |