diff options
author | Michael Brasser <mbrasser@ford.com> | 2018-08-28 08:10:21 -0500 |
---|---|---|
committer | Michael Brasser <michael.brasser@live.com> | 2018-08-28 15:29:42 +0000 |
commit | 854217d60da9ab54795fb39896a053f301222848 (patch) | |
tree | 6ec473609c37795a133f1084c7a6a4d6697f1cd0 | |
parent | 2be71ac8a46effa8cf39a8f034fbd7a36d6d6d27 (diff) |
Update import statement to "import QtRemoteObjects 5.12"
Keep "import QtQml.RemoteObjects 1.0" for compatibility.
[ChangeLog][QML] Updated import statement to better
match typical module pattern. From QML "import QtRemoteObjects 5.12"
should now be used.
Change-Id: I0224e387b5bea3be5907485e4fca505f2fb3fb3e
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | src/imports/compat/compat.pro | 13 | ||||
-rw-r--r-- | src/imports/compat/plugin.cpp | 65 | ||||
-rw-r--r-- | src/imports/compat/plugins.qmltypes | 74 | ||||
-rw-r--r-- | src/imports/compat/qmldir | 3 | ||||
-rw-r--r-- | src/imports/imports.pro | 1 | ||||
-rw-r--r-- | src/imports/remoteobjects/plugin.cpp | 14 | ||||
-rw-r--r-- | src/imports/remoteobjects/plugins.qmltypes | 8 | ||||
-rw-r--r-- | src/imports/remoteobjects/qmldir | 6 | ||||
-rw-r--r-- | src/imports/remoteobjects/remoteobjects.pro | 6 | ||||
-rw-r--r-- | src/remoteobjects/doc/src/remoteobjects-qml.qdoc | 6 | ||||
-rw-r--r-- | src/remoteobjects/qremoteobjectnode.cpp | 2 | ||||
-rw-r--r-- | src/remoteobjects/qremoteobjectsettingsstore.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/integration/data/tst_integration.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/usertypes/data/complex.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/usertypes/data/extraPropComplex.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/usertypes/data/extraprop.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/usertypes/data/model.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/usertypes/data/subObject.qml | 2 |
18 files changed, 185 insertions, 27 deletions
diff --git a/src/imports/compat/compat.pro b/src/imports/compat/compat.pro new file mode 100644 index 0000000..a73526e --- /dev/null +++ b/src/imports/compat/compat.pro @@ -0,0 +1,13 @@ +CXX_MODULE = qml +TARGET = qtqmlremoteobjects +TARGETPATH = QtQml/RemoteObjects +IMPORT_VERSION = 1.0 + +QT += qml remoteobjects + +SOURCES = \ + $$PWD/plugin.cpp \ + +HEADERS = \ + +load(qml_plugin) diff --git a/src/imports/compat/plugin.cpp b/src/imports/compat/plugin.cpp new file mode 100644 index 0000000..c4cc496 --- /dev/null +++ b/src/imports/compat/plugin.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2017-2015 Ford Motor Company +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtRemoteObjects 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 <QtRemoteObjects/qremoteobjectnode.h> +#include <QtRemoteObjects/qremoteobjectsettingsstore.h> +#include <QQmlExtensionPlugin> +#include <qqml.h> + +QT_BEGIN_NAMESPACE + +class QtQmlRemoteObjectsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + void registerTypes(const char *uri) override + { + qmlRegisterUncreatableType<QRemoteObjectAbstractPersistedStore>(uri, 1, 0, "PersistedStore", "Cannot create PersistedStore"); + + qmlRegisterType<QRemoteObjectNode>(uri, 1, 0, "Node"); + qmlRegisterType<QRemoteObjectSettingsStore>(uri, 1, 0, "SettingsStore"); + qmlProtectModule(uri, 1); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" diff --git a/src/imports/compat/plugins.qmltypes b/src/imports/compat/plugins.qmltypes new file mode 100644 index 0000000..4839d3a --- /dev/null +++ b/src/imports/compat/plugins.qmltypes @@ -0,0 +1,74 @@ +import QtQuick.tooling 1.2 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. +// +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable QtQml.RemoteObjects 1.0' + +Module { + dependencies: ["QtQuick 2.8"] + Component { + name: "QRemoteObjectAbstractPersistedStore" + prototype: "QObject" + exports: ["QtQml.RemoteObjects/PersistedStore 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + } + Component { + name: "QRemoteObjectNode" + prototype: "QObject" + exports: ["QtQml.RemoteObjects/Node 1.0"] + exportMetaObjectRevisions: [0] + Enum { + name: "ErrorCode" + values: { + "NoError": 0, + "RegistryNotAcquired": 1, + "RegistryAlreadyHosted": 2, + "NodeIsNoServer": 3, + "ServerAlreadyCreated": 4, + "UnintendedRegistryHosting": 5, + "OperationNotValidOnClientNode": 6, + "SourceNotRegistered": 7, + "MissingObjectName": 8, + "HostUrlInvalid": 9, + "ProtocolMismatch": 10 + } + } + Property { name: "registryUrl"; type: "QUrl" } + Property { + name: "persistedStore" + type: "QRemoteObjectAbstractPersistedStore" + isPointer: true + } + Property { name: "heartbeatInterval"; type: "int" } + Signal { + name: "remoteObjectAdded" + Parameter { type: "QRemoteObjectSourceLocation" } + } + Signal { + name: "remoteObjectRemoved" + Parameter { type: "QRemoteObjectSourceLocation" } + } + Signal { + name: "error" + Parameter { name: "errorCode"; type: "QRemoteObjectNode::ErrorCode" } + } + Signal { + name: "heartbeatIntervalChanged" + Parameter { name: "heartbeatInterval"; type: "int" } + } + Method { + name: "connectToNode" + type: "bool" + Parameter { name: "address"; type: "QUrl" } + } + } + Component { + name: "QRemoteObjectSettingsStore" + prototype: "QRemoteObjectAbstractPersistedStore" + exports: ["QtQml.RemoteObjects/SettingsStore 1.0"] + exportMetaObjectRevisions: [0] + } +} diff --git a/src/imports/compat/qmldir b/src/imports/compat/qmldir new file mode 100644 index 0000000..e6f2c53 --- /dev/null +++ b/src/imports/compat/qmldir @@ -0,0 +1,3 @@ +module QtQml.RemoteObjects +plugin qtqmlremoteobjects +classname QtQmlRemoteObjectsPlugin diff --git a/src/imports/imports.pro b/src/imports/imports.pro index b956f4c..0689b78 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS += \ + compat \ remoteobjects diff --git a/src/imports/remoteobjects/plugin.cpp b/src/imports/remoteobjects/plugin.cpp index a4fbdd9..0bec1a9 100644 --- a/src/imports/remoteobjects/plugin.cpp +++ b/src/imports/remoteobjects/plugin.cpp @@ -44,19 +44,21 @@ QT_BEGIN_NAMESPACE -class QtQmlRemoteObjectsPlugin : public QQmlExtensionPlugin +class QtRemoteObjectsPlugin : public QQmlExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtQml.RemoteObjects/1.0") + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: void registerTypes(const char *uri) override { - qmlRegisterUncreatableType<QRemoteObjectAbstractPersistedStore>(uri, 1, 0, "PersistedStore", "Cannot create PersistedStore"); + qmlRegisterModule(uri, 5, QT_VERSION_MINOR); - qmlRegisterType<QRemoteObjectNode>(uri, 1, 0, "Node"); - qmlRegisterType<QRemoteObjectSettingsStore>(uri, 1, 0, "SettingsStore"); - qmlProtectModule(uri, 1); + qmlRegisterUncreatableType<QRemoteObjectAbstractPersistedStore>(uri, 5, 12, "PersistedStore", "Cannot create PersistedStore"); + + qmlRegisterType<QRemoteObjectNode>(uri, 5, 12, "Node"); + qmlRegisterType<QRemoteObjectSettingsStore>(uri, 5, 12, "SettingsStore"); + qmlProtectModule(uri, 5); } }; diff --git a/src/imports/remoteobjects/plugins.qmltypes b/src/imports/remoteobjects/plugins.qmltypes index 4839d3a..3891b4a 100644 --- a/src/imports/remoteobjects/plugins.qmltypes +++ b/src/imports/remoteobjects/plugins.qmltypes @@ -4,21 +4,21 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtQml.RemoteObjects 1.0' +// 'qmlplugindump -nonrelocatable QtRemoteObjects 5.12' Module { dependencies: ["QtQuick 2.8"] Component { name: "QRemoteObjectAbstractPersistedStore" prototype: "QObject" - exports: ["QtQml.RemoteObjects/PersistedStore 1.0"] + exports: ["QtRemoteObjects/PersistedStore 5.12"] isCreatable: false exportMetaObjectRevisions: [0] } Component { name: "QRemoteObjectNode" prototype: "QObject" - exports: ["QtQml.RemoteObjects/Node 1.0"] + exports: ["QtRemoteObjects/Node 5.12"] exportMetaObjectRevisions: [0] Enum { name: "ErrorCode" @@ -68,7 +68,7 @@ Module { Component { name: "QRemoteObjectSettingsStore" prototype: "QRemoteObjectAbstractPersistedStore" - exports: ["QtQml.RemoteObjects/SettingsStore 1.0"] + exports: ["QtRemoteObjects/SettingsStore 5.12"] exportMetaObjectRevisions: [0] } } diff --git a/src/imports/remoteobjects/qmldir b/src/imports/remoteobjects/qmldir index e6f2c53..a8d960b 100644 --- a/src/imports/remoteobjects/qmldir +++ b/src/imports/remoteobjects/qmldir @@ -1,3 +1,3 @@ -module QtQml.RemoteObjects -plugin qtqmlremoteobjects -classname QtQmlRemoteObjectsPlugin +module QtRemoteObjects +plugin qtremoteobjects +classname QtRemoteObjectsPlugin diff --git a/src/imports/remoteobjects/remoteobjects.pro b/src/imports/remoteobjects/remoteobjects.pro index a73526e..a902780 100644 --- a/src/imports/remoteobjects/remoteobjects.pro +++ b/src/imports/remoteobjects/remoteobjects.pro @@ -1,7 +1,7 @@ CXX_MODULE = qml -TARGET = qtqmlremoteobjects -TARGETPATH = QtQml/RemoteObjects -IMPORT_VERSION = 1.0 +TARGET = qtremoteobjects +TARGETPATH = QtRemoteObjects +IMPORT_VERSION = 5.12 QT += qml remoteobjects diff --git a/src/remoteobjects/doc/src/remoteobjects-qml.qdoc b/src/remoteobjects/doc/src/remoteobjects-qml.qdoc index bf810d5..e6a874b 100644 --- a/src/remoteobjects/doc/src/remoteobjects-qml.qdoc +++ b/src/remoteobjects/doc/src/remoteobjects-qml.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! -\qmlmodule QtQml.RemoteObjects 1.0 +\qmlmodule QtRemoteObjects 5.12 \title Qt Remote Objects QML Types \ingroup qmlmodules \brief Provides QML types for remote objects support. @@ -50,7 +50,7 @@ qmlRegisterType<MyTypeReplica>("custom",1,0,"MyTypeReplica") And then used from QML in conjunction with the base type Node: \code import QtQuick 2.0 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 import custom 1.0 Item { @@ -79,7 +79,7 @@ console.log(myType.myProp) // logs "Hello World", as the new text has not yet be The QML types in this module can be imported into your application using the following import statement in your .qml file: \code -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 \endcode \section1 QML Types diff --git a/src/remoteobjects/qremoteobjectnode.cpp b/src/remoteobjects/qremoteobjectnode.cpp index ad2e084..19b9d14 100644 --- a/src/remoteobjects/qremoteobjectnode.cpp +++ b/src/remoteobjects/qremoteobjectnode.cpp @@ -93,7 +93,7 @@ bool map_contains(const QMap<K,V> &map, const Query &key, typename QMap<K,V>::co /*! \qmltype Node \instantiates QRemoteObjectNode - \inqmlmodule QtQml.RemoteObjects + \inqmlmodule QtRemoteObjects \brief A node on a Qt Remote Objects network. The Node type provides an entry point to a Qt Remote Objects network. A network diff --git a/src/remoteobjects/qremoteobjectsettingsstore.cpp b/src/remoteobjects/qremoteobjectsettingsstore.cpp index 2fce7ac..97e6cdc 100644 --- a/src/remoteobjects/qremoteobjectsettingsstore.cpp +++ b/src/remoteobjects/qremoteobjectsettingsstore.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE /*! \qmltype SettingsStore - \inqmlmodule QtQml.RemoteObjects + \inqmlmodule QtRemoteObjects \brief A basic store for persisted properties. This type provides simple QSettings-based storage for properties marked as PERSISTED. It is used in diff --git a/tests/auto/qml/integration/data/tst_integration.qml b/tests/auto/qml/integration/data/tst_integration.qml index 0f8b115..0d46953 100644 --- a/tests/auto/qml/integration/data/tst_integration.qml +++ b/tests/auto/qml/integration/data/tst_integration.qml @@ -27,7 +27,7 @@ ****************************************************************************/ import QtTest 1.1 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 TestCase { id: testCase diff --git a/tests/auto/qml/usertypes/data/complex.qml b/tests/auto/qml/usertypes/data/complex.qml index 4d80717..94c66eb 100644 --- a/tests/auto/qml/usertypes/data/complex.qml +++ b/tests/auto/qml/usertypes/data/complex.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 import usertypes 1.0 ComplexTypeReplica { diff --git a/tests/auto/qml/usertypes/data/extraPropComplex.qml b/tests/auto/qml/usertypes/data/extraPropComplex.qml index 801b0b2..bd16bbc 100644 --- a/tests/auto/qml/usertypes/data/extraPropComplex.qml +++ b/tests/auto/qml/usertypes/data/extraPropComplex.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 import usertypes 1.0 ComplexTypeReplica { diff --git a/tests/auto/qml/usertypes/data/extraprop.qml b/tests/auto/qml/usertypes/data/extraprop.qml index c37721b..5c48de3 100644 --- a/tests/auto/qml/usertypes/data/extraprop.qml +++ b/tests/auto/qml/usertypes/data/extraprop.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 import usertypes 1.0 SimpleClockReplica { diff --git a/tests/auto/qml/usertypes/data/model.qml b/tests/auto/qml/usertypes/data/model.qml index 4be7bc8..2807d18 100644 --- a/tests/auto/qml/usertypes/data/model.qml +++ b/tests/auto/qml/usertypes/data/model.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 import usertypes 1.0 TypeWithModelReplica { diff --git a/tests/auto/qml/usertypes/data/subObject.qml b/tests/auto/qml/usertypes/data/subObject.qml index 90c6adb..fc7eb10 100644 --- a/tests/auto/qml/usertypes/data/subObject.qml +++ b/tests/auto/qml/usertypes/data/subObject.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import QtQml.RemoteObjects 1.0 +import QtRemoteObjects 5.12 import usertypes 1.0 Item { |