From c0c3066d25678a92bcb2932b6595d019e9613d27 Mon Sep 17 00:00:00 2001 From: Dan Ackers Date: Mon, 21 Jun 2021 11:19:40 +0300 Subject: Port qtdeviceutilities to use declarative types Task-number: QTBUG-94426 Change-Id: I9ac17f38eccff96e25a6c1d40998b222d349274d Reviewed-by: Teemu Holappa --- src/CMakeLists.txt | 2 +- src/doc/qtdeviceutilities-project.qdocconf | 2 +- src/imports/CMakeLists.txt | 3 - src/imports/networksettings/CMakeLists.txt | 22 --- src/imports/networksettings/plugin.cpp | 191 ------------------- src/imports/networksettings/plugin.h | 48 ----- src/imports/networksettings/plugins.qmltypes | 205 -------------------- src/imports/networksettings/qmldir | 4 - .../networksettingsqml/CMakeLists.txt | 14 ++ .../networksettingsqml/qnetworksettingsforeign.cpp | 151 +++++++++++++++ .../networksettingsqml/qnetworksettingsforeign.h | 121 ++++++++++++ src/networksettings/qnetworksettingsmanager.h | 8 +- .../qtbuttonimageproviderplugin/CMakeLists.txt | 24 +-- .../qtbuttonimageproviderplugin/plugin.cpp | 42 +---- .../qtbuttonimageproviderplugin/plugin_p.h | 79 ++++++++ .../qtbuttonimageproviderplugin/plugins.qmltypes | 210 --------------------- src/settingsui/qtbuttonimageproviderplugin/qmldir | 3 - .../qtbuttonimageprovider.qrc | 5 - src/settingsui/settingsuiplugin/CMakeLists.txt | 45 ++--- src/settingsui/settingsuiplugin/icons.qrc | 12 -- src/settingsui/settingsuiplugin/plugin.cpp | 34 +--- src/settingsui/settingsuiplugin/plugin_p.h | 56 ++++++ src/settingsui/settingsuiplugin/plugins.qmltypes | 32 ---- src/settingsui/settingsuiplugin/qmldir | 4 - src/settingsui/settingsuiplugin/settingsui.qrc | 31 --- 25 files changed, 460 insertions(+), 888 deletions(-) delete mode 100644 src/imports/CMakeLists.txt delete mode 100644 src/imports/networksettings/CMakeLists.txt delete mode 100644 src/imports/networksettings/plugin.cpp delete mode 100644 src/imports/networksettings/plugin.h delete mode 100644 src/imports/networksettings/plugins.qmltypes delete mode 100644 src/imports/networksettings/qmldir create mode 100644 src/networksettings/networksettingsqml/CMakeLists.txt create mode 100644 src/networksettings/networksettingsqml/qnetworksettingsforeign.cpp create mode 100644 src/networksettings/networksettingsqml/qnetworksettingsforeign.h create mode 100644 src/settingsui/qtbuttonimageproviderplugin/plugin_p.h delete mode 100644 src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes delete mode 100644 src/settingsui/qtbuttonimageproviderplugin/qmldir delete mode 100644 src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc delete mode 100644 src/settingsui/settingsuiplugin/icons.qrc create mode 100644 src/settingsui/settingsuiplugin/plugin_p.h delete mode 100644 src/settingsui/settingsuiplugin/plugins.qmltypes delete mode 100644 src/settingsui/settingsuiplugin/qmldir delete mode 100644 src/settingsui/settingsuiplugin/settingsui.qrc (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c6ad787..25640ce 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(networksettings) +add_subdirectory(networksettings/networksettingsqml) add_subdirectory(settingsui/settingsuiplugin) add_subdirectory(settingsui/qtbuttonimageproviderplugin) add_subdirectory(settingsui) -add_subdirectory(imports) add_subdirectory(doc) diff --git a/src/doc/qtdeviceutilities-project.qdocconf b/src/doc/qtdeviceutilities-project.qdocconf index f0ff0a3..cfd5d5a 100644 --- a/src/doc/qtdeviceutilities-project.qdocconf +++ b/src/doc/qtdeviceutilities-project.qdocconf @@ -12,7 +12,7 @@ includepaths += -I . \ moduleheader = QtDeviceUtilitiesDoc sourcedirs += src \ - ../imports/networksettings \ + ../networksettings/networksettingsqml \ ../networksettings headerdirs += ../networksettings diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt deleted file mode 100644 index 163fe57..0000000 --- a/src/imports/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Generated from imports.pro. - -add_subdirectory(networksettings) diff --git a/src/imports/networksettings/CMakeLists.txt b/src/imports/networksettings/CMakeLists.txt deleted file mode 100644 index 60f8a64..0000000 --- a/src/imports/networksettings/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -##################################################################### -## networksettingsplugin Plugin: -##################################################################### - -qt_internal_add_qml_module(networksettingsplugin - URI "QtDeviceUtilities.NetworkSettings" - VERSION "${CMAKE_PROJECT_VERSION}" - CLASS_NAME NetworkSettingsQmlPlugin - PLUGIN_TARGET networksettingsplugin - NO_GENERATE_PLUGIN_SOURCE - NO_PLUGIN_OPTIONAL - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" - SOURCES - plugin.cpp plugin.h - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick - Qt::NetworkSettings -) diff --git a/src/imports/networksettings/plugin.cpp b/src/imports/networksettings/plugin.cpp deleted file mode 100644 index e4d6cee..0000000 --- a/src/imports/networksettings/plugin.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "plugin.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/*! - \qmlmodule QtDeviceUtilities.NetworkSettings - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \title Qt Network Settings QML Types - - \brief Provides singleton QML types for controlling network settings. - - Qt Network Settings QML module provides singleton QML types for controlling - network settings in an embedded device. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.NetworkSettings - \endcode - - \l{Qt Device Utilities WiFi Tutorial} demonstrates how you can use - \l{QtDeviceUtilities.NetworkSettings}{NetworkSettings} for connecting to WiFi. - - \note Some functions may not be available on all of the platforms. - - \section1 QML Types -*/ - -/*! - \qmltype NetworkSettingsManager - \inqmlmodule QtDeviceUtilities.NetworkSettings - \brief A singleton QML type for managing network settings. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.NetworkSettings} module. - - \l{Qt Device Utilities WiFi Tutorial} demonstrates how you can use - \l{NetworkSettingsManager} for connecting to WiFi. -*/ - -/*! - \qmlproperty model NetworkSettingsManager::services - \readonly - - Holds the service model. - - The services list in the model can be controlled with the - \c type property, and NetworkService items can be retrieved - with the \c {itemFromRow(int index)} method. For example, to - select the first available wired network service: - - \code - property var service: null - ... - NetworkSettingsManager.services.type = NetworkSettingsType.Wired; - service = NetworkSettingsManager.services.itemFromRow(0); - \endcode - - Available service types: - - \value NetworkSettingsType.Wired Wired network - \value NetworkSettingsType.Wifi Wifi network - \value NetworkSettingsType.Bluetooth Bluetooth network - \value NetworkSettingsType.Unknown Unknown network type - - \sa NetworkService -*/ - -/*! - \qmlproperty model NetworkSettingsManager::interfaces - \readonly - - Holds the interface model. A delegate in a view that uses - the \e interfaces model can access the NetworkInterface - item with the \e dataModel role. - - \sa NetworkInterface -*/ - -/*! - \qmlmethod NetworkService NetworkSettingsManager::service(string name, int type) - - Returns the service with name \a name and type \a type. - - \sa services -*/ - -/*! - \qmlmethod NetworkInterface NetworkSettingsManager::interface(int type, int instance) - - Returns the interface with type \a type and order number of \a instance - - \sa NetworkInterface -*/ - -/*! - \qmlmethod NetworkSettingsManager::userAgent.setPassphrase(string passphrase) - - Sets the \a passphrase for connecting to a Wifi network. - - This method needs to be called in response to receiving a showUserCredentialsInput() signal. - - \sa userAgent.showUserCredentialsInput() -*/ - -/*! - \qmlsignal NetworkSettingsManager::userAgent.showUserCredentialsInput() - - This signal is emitted when user credentials are required for connecting to a Wifi network. - - \sa userAgent.setPassphrase() -*/ - -/*! - \qmlmethod NetworkSettingsManager::userAgent.cancelInput() - - Cancels the user credentials input request. -*/ - -/*! - \qmlsignal NetworkSettingsManager::userAgent.error() - - This signal is emitted when the connection failed due to invalid user credentials. -*/ - -QT_BEGIN_NAMESPACE - -template -QObject *instance(QQmlEngine *engine, QJSEngine *) { - T *t = new T(engine); - t->setObjectName(T::staticMetaObject.className()); - return t; -} - -void NetworkSettingsQmlPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtDeviceUtilities.NetworkSettings")); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkService", "Cannot be instantiated directly."); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkInterface", "Cannot be instantiated directly."); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkSettingsIPv4", "Cannot be instantiated directly."); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkSettingsIPv6", "Cannot be instantiated directly."); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkSettingsProxy", "Cannot be instantiated directly."); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkSettingsType", "Cannot be instantiated directly."); - qmlRegisterUncreatableType(uri, 1, 0, "NetworkSettingsState", "Cannot be instantiated directly."); - - qRegisterMetaType("QNetworkSettingsUserAgent*"); - qRegisterMetaType("QNetworkSettingsServiceFilter*"); - qRegisterMetaType("QNetworkSettingsInterfaceModel*"); - - qmlRegisterSingletonType(uri, 2, 0, "NetworkSettingsManager", &instance); -} - -QT_END_NAMESPACE diff --git a/src/imports/networksettings/plugin.h b/src/imports/networksettings/plugin.h deleted file mode 100644 index 6125127..0000000 --- a/src/imports/networksettings/plugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef NETWORKSETTINGSPLUGIN_PLUGIN_H -#define NETWORKSETTINGSPLUGIN_PLUGIN_H - -#include - -QT_BEGIN_NAMESPACE - -class NetworkSettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) override; -}; - -QT_END_NAMESPACE - -#endif // NETWORKSETTINGSPLUGIN_PLUGIN_H - diff --git a/src/imports/networksettings/plugins.qmltypes b/src/imports/networksettings/plugins.qmltypes deleted file mode 100644 index f2603eb..0000000 --- a/src/imports/networksettings/plugins.qmltypes +++ /dev/null @@ -1,205 +0,0 @@ -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 QtDeviceUtilities.NetworkSettings 1.0' - -Module { - dependencies: ["QtQuick 2.8"] - Component { - name: "QNetworkSettingsIPv4" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkSettingsIPv4 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "MethodType" - values: { - "Dhcp": 0, - "Manual": 1, - "Off": 2 - } - } - Property { name: "address"; type: "string" } - Property { name: "gateway"; type: "string" } - Property { name: "method"; type: "MethodType" } - Property { name: "mask"; type: "string" } - } - Component { - name: "QNetworkSettingsIPv6" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkSettingsIPv6 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "MethodType" - values: { - "Auto": 0, - "Manual": 1, - "Off": 2 - } - } - Enum { - name: "PrivacyType" - values: { - "Disabled": 0, - "Enabled": 1, - "Preferred": 2 - } - } - Property { name: "address"; type: "string" } - Property { name: "gateway"; type: "string" } - Property { name: "method"; type: "MethodType" } - Property { name: "privacy"; type: "PrivacyType" } - Property { name: "prefixLength"; type: "int" } - } - Component { - name: "QNetworkSettingsInterface" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkInterface 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "name"; type: "string"; isReadonly: true } - Property { name: "state"; type: "QNetworkSettingsState::States"; isReadonly: true } - Property { name: "type"; type: "QNetworkSettingsType::Types"; isReadonly: true } - Property { name: "powered"; type: "bool" } - Method { name: "scanServices" } - } - Component { - name: "QNetworkSettingsManager" - prototype: "QObject" - exports: [ - "QtDeviceUtilities.NetworkSettings/NetworkSettingsManager 1.0" - ] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { - name: "services" - type: "QNetworkSettingsServiceFilter" - isReadonly: true - isPointer: true - } - Property { - name: "interfaces" - type: "QNetworkSettingsInterfaceModel" - isReadonly: true - isPointer: true - } - Property { - name: "userAgent" - type: "QNetworkSettingsUserAgent" - isReadonly: true - isPointer: true - } - Method { - name: "service" - type: "QNetworkSettingsService*" - Parameter { name: "name"; type: "string" } - Parameter { name: "type"; type: "int" } - } - Method { - name: "interface" - type: "QNetworkSettingsInterface*" - Parameter { name: "type"; type: "int" } - Parameter { name: "instance"; type: "int" } - } - } - Component { - name: "QNetworkSettingsProxy" - prototype: "QObject" - exports: [ - "QtDeviceUtilities.NetworkSettings/NetworkSettingsProxy 1.0" - ] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "MethodType" - values: { - "Direct": 0, - "Auto": 1, - "Manual": 2 - } - } - Property { name: "url"; type: "QUrl" } - Property { name: "servers"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Property { name: "excludes"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Property { name: "method"; type: "MethodType" } - } - Component { - name: "QNetworkSettingsService" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkService 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "id"; type: "string"; isReadonly: true } - Property { name: "name"; type: "string"; isReadonly: true } - Property { name: "state"; type: "QNetworkSettingsState::States"; isReadonly: true } - Property { name: "type"; type: "QNetworkSettingsType::Types"; isReadonly: true } - Property { name: "ipv4"; type: "QNetworkSettingsIPv4"; isReadonly: true; isPointer: true } - Property { name: "ipv6"; type: "QNetworkSettingsIPv6"; isReadonly: true; isPointer: true } - Property { name: "proxy"; type: "QNetworkSettingsProxy"; isReadonly: true; isPointer: true } - Property { - name: "wirelessConfig" - type: "QNetworkSettingsWireless" - isReadonly: true - isPointer: true - } - Property { name: "domains"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Property { name: "nameservers"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Signal { name: "wirelessChanged" } - Method { - name: "setAutoConnect" - Parameter { name: "autoconnect"; type: "bool" } - } - Method { name: "setupIpv4Config" } - Method { name: "setupIpv6Config" } - Method { name: "setupNameserversConfig" } - Method { name: "setupDomainsConfig" } - Method { name: "setupNetworkSettingsProxy" } - Method { name: "connectService" } - Method { name: "disconnectService" } - } - Component { - name: "QNetworkSettingsState" - prototype: "QObject" - exports: [ - "QtDeviceUtilities.NetworkSettings/NetworkSettingsState 1.0" - ] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "States" - values: { - "Idle": 0, - "Failure": 1, - "Association": 2, - "Configuration": 3, - "Ready": 4, - "Disconnect": 5, - "Online": 6, - "Undefined": 7 - } - } - Property { name: "state"; type: "States" } - } - Component { - name: "QNetworkSettingsType" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkSettingsType 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "Types" - values: { - "Wired": 0, - "Wifi": 1, - "Bluetooth": 2, - "Unknown": 3 - } - } - Property { name: "type"; type: "Types" } - } -} diff --git a/src/imports/networksettings/qmldir b/src/imports/networksettings/qmldir deleted file mode 100644 index 64b8d6e..0000000 --- a/src/imports/networksettings/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.NetworkSettings -plugin networksettingsplugin -classname NetworkSettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/networksettings/networksettingsqml/CMakeLists.txt b/src/networksettings/networksettingsqml/CMakeLists.txt new file mode 100644 index 0000000..a2c8403 --- /dev/null +++ b/src/networksettings/networksettingsqml/CMakeLists.txt @@ -0,0 +1,14 @@ +qt_internal_add_qml_module(networksettingsqml + URI "QtDeviceUtilities.NetworkSettings" + VERSION "${CMAKE_PROJECT_VERSION}" + PAST_MAJOR_VERSIONS 1 + PLUGIN_TARGET networksettingsqml + DEPENDENCIES + QtQml + SOURCES + qnetworksettingsforeign.h qnetworksettingsforeign.cpp + PUBLIC_LIBRARIES + Qt::Core + Qt::Qml + Qt::NetworkSettings +) diff --git a/src/networksettings/networksettingsqml/qnetworksettingsforeign.cpp b/src/networksettings/networksettingsqml/qnetworksettingsforeign.cpp new file mode 100644 index 0000000..e3d1414 --- /dev/null +++ b/src/networksettings/networksettingsqml/qnetworksettingsforeign.cpp @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Device Utilities module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "qnetworksettingsforeign.h" + +/*! + \qmlmodule QtDeviceUtilities.NetworkSettings + \ingroup qtdevice-utilities-qml-modules + \ingroup qmlmodules + \title Qt Network Settings QML Types + + \brief Provides singleton QML types for controlling network settings. + + Qt Network Settings QML module provides singleton QML types for controlling + network settings in an embedded device. + + To import and use the module's QML types, use the following statement: + + \badcode + import QtDeviceUtilities.NetworkSettings + \endcode + + \l{Qt Device Utilities WiFi Tutorial} demonstrates how you can use + \l{QtDeviceUtilities.NetworkSettings}{NetworkSettings} for connecting to WiFi. + + \note Some functions may not be available on all of the platforms. + + \section1 QML Types +*/ + +/*! + \qmltype NetworkSettingsManager + \inqmlmodule QtDeviceUtilities.NetworkSettings + \brief A singleton QML type for managing network settings. + + There is no need to create an instance of this object. To use it, + simply import the \c {QtDeviceUtilities.NetworkSettings} module. + + \l{Qt Device Utilities WiFi Tutorial} demonstrates how you can use + \l{NetworkSettingsManager} for connecting to WiFi. +*/ + +/*! + \qmlproperty model NetworkSettingsManager::services + \readonly + + Holds the service model. + + The services list in the model can be controlled with the + \c type property, and NetworkService items can be retrieved + with the \c {itemFromRow(int index)} method. For example, to + select the first available wired network service: + + \code + property var service: null + ... + NetworkSettingsManager.services.type = NetworkSettingsType.Wired; + service = NetworkSettingsManager.services.itemFromRow(0); + \endcode + + Available service types: + + \value NetworkSettingsType.Wired Wired network + \value NetworkSettingsType.Wifi Wifi network + \value NetworkSettingsType.Bluetooth Bluetooth network + \value NetworkSettingsType.Unknown Unknown network type + + \sa NetworkService +*/ + +/*! + \qmlproperty model NetworkSettingsManager::interfaces + \readonly + + Holds the interface model. A delegate in a view that uses + the \e interfaces model can access the NetworkInterface + item with the \e dataModel role. + + \sa NetworkInterface +*/ + +/*! + \qmlmethod NetworkService NetworkSettingsManager::service(string name, int type) + + Returns the service with name \a name and type \a type. + + \sa services +*/ + +/*! + \qmlmethod NetworkInterface NetworkSettingsManager::interface(int type, int instance) + + Returns the interface with type \a type and order number of \a instance + + \sa NetworkInterface +*/ + +/*! + \qmlmethod NetworkSettingsManager::userAgent.setPassphrase(string passphrase) + + Sets the \a passphrase for connecting to a Wifi network. + + This method needs to be called in response to receiving a showUserCredentialsInput() signal. + + \sa userAgent.showUserCredentialsInput() +*/ + +/*! + \qmlsignal NetworkSettingsManager::userAgent.showUserCredentialsInput() + + This signal is emitted when user credentials are required for connecting to a Wifi network. + + \sa userAgent.setPassphrase() +*/ + +/*! + \qmlmethod NetworkSettingsManager::userAgent.cancelInput() + + Cancels the user credentials input request. +*/ + +/*! + \qmlsignal NetworkSettingsManager::userAgent.error() + + This signal is emitted when the connection failed due to invalid user credentials. +*/ diff --git a/src/networksettings/networksettingsqml/qnetworksettingsforeign.h b/src/networksettings/networksettingsqml/qnetworksettingsforeign.h new file mode 100644 index 0000000..b979397 --- /dev/null +++ b/src/networksettings/networksettingsqml/qnetworksettingsforeign.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Device Utilities module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef NETWORKSETTINGSPLUGIN_PLUGIN_H +#define NETWORKSETTINGSPLUGIN_PLUGIN_H + +#include +#include +#include +#include +#include +#include +#include +#include + +Q_DECLARE_METATYPE(QNetworkSettingsUserAgent) +Q_DECLARE_METATYPE(QNetworkSettingsServiceFilter) +Q_DECLARE_METATYPE(QNetworkSettingsInterfaceModel) + +QT_BEGIN_NAMESPACE + +struct NetworkSettingsServiceForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsService) + QML_NAMED_ELEMENT(NetworkSettingsService) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsInterfaceForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsInterface) + QML_NAMED_ELEMENT(NetworkSettingsInterface) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsIPv4Foreign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsIPv4) + QML_NAMED_ELEMENT(NetworkSettingsIPv4) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsIPv6Foreign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsIPv6) + QML_NAMED_ELEMENT(NetworkSettingsIPv6) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsProxyForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsProxy) + QML_NAMED_ELEMENT(NetworkSettingsProxy) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsTypeForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsType) + QML_NAMED_ELEMENT(NetworkSettingsType) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsStateForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsState) + QML_NAMED_ELEMENT(NetworkSettingsState) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +class QNetworkSettingsManagerForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(NetworkSettingsManager) + QML_SINGLETON + QML_ADDED_IN_VERSION(2, 0) +}; + +QT_END_NAMESPACE + +#endif // NETWORKSETTINGSPLUGIN_PLUGIN_H + diff --git a/src/networksettings/qnetworksettingsmanager.h b/src/networksettings/qnetworksettingsmanager.h index 8526324..01159dd 100644 --- a/src/networksettings/qnetworksettingsmanager.h +++ b/src/networksettings/qnetworksettingsmanager.h @@ -32,10 +32,10 @@ #include #include #include -#include "qnetworksettingsservicemodel.h" -#include "qnetworksettingsinterfacemodel.h" -#include "qnetworksettingsuseragent.h" -#include "qnetworksettingsservice.h" +#include +#include +#include +#include QT_FORWARD_DECLARE_CLASS(QNetworkSettingsManagerPrivate) QT_FORWARD_DECLARE_CLASS(QNetworkSettingsInterface) diff --git a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt b/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt index b8c0f0c..410caea 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt +++ b/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt @@ -7,28 +7,20 @@ qt_internal_add_qml_module(qtbuttonimageproviderplugin VERSION "${CMAKE_PROJECT_VERSION}" CLASS_NAME QtButtonImageProviderQmlPlugin PLUGIN_TARGET qtbuttonimageproviderplugin - NO_GENERATE_PLUGIN_SOURCE NO_PLUGIN_OPTIONAL - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" + NO_GENERATE_PLUGIN_SOURCE + CLASS_NAME QtButtonImageProviderPlugin + PAST_MAJOR_VERSIONS 1 + DEPENDENCIES + QtQml SOURCES - plugin.cpp + plugin.cpp plugin_p.h qtbuttonimageprovider.cpp qtbuttonimageprovider.h PUBLIC_LIBRARIES Qt::Core Qt::Gui Qt::Qml Qt::Quick -) - -# Resources: -set(qtbuttonimageprovider_resource_files - "QtButton.qml" -) - -qt_internal_add_resource(qtbuttonimageproviderplugin "qtbuttonimageprovider" - PREFIX - "/" - FILES - ${qtbuttonimageprovider_resource_files} + QML_FILES + "QtButton.qml" ) diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp index c017a05..30ede2a 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp +++ b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp @@ -26,44 +26,4 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include -#include - -#include "qtbuttonimageprovider.h" - -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtDeviceUtilities_QtButtonImageProvider); -#endif - Q_INIT_RESOURCE(qtbuttonimageprovider); -} - -QT_BEGIN_NAMESPACE - -class QtButtonImageProviderQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QtButtonImageProviderQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); } - - void registerTypes(const char *uri) override - { - Q_UNUSED(uri) - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.QtButtonImageProvider")); - qmlRegisterType(QUrl("qrc:/QtButton.qml"), uri, 1, 0, "QtButton"); - } - - void initializeEngine(QQmlEngine *engine, const char *uri) override - { - Q_UNUSED(uri); - QtButtonImageProvider *provider = new QtButtonImageProvider(); - engine->addImageProvider("QtButton", provider); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" +#include "plugin_p.h" diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h b/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h new file mode 100644 index 0000000..9fa479d --- /dev/null +++ b/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Device Utilities module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QTBUTTONIMAGEPROVIDERQMLPLUGIN_H +#define QTBUTTONIMAGEPROVIDERQMLPLUGIN_H + +#include +#include + +#include "qtbuttonimageprovider.h" + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +extern void qml_register_types_QtDeviceUtilities_QtButtonImageProvider(); + +QT_BEGIN_NAMESPACE + +struct QtButtonForeign +{ + Q_GADGET + QML_NAMED_ELEMENT(QtButton) + QML_ADDED_IN_VERSION(1, 0) +}; + +class QtButtonImageProviderQmlPlugin : public QQmlEngineExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtButtonImageProviderQmlPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) { + volatile auto registration = &qml_register_types_QtDeviceUtilities_QtButtonImageProvider; + Q_UNUSED(registration); + } + + void initializeEngine(QQmlEngine *engine, const char *uri) override + { + Q_UNUSED(uri); + QtButtonImageProvider *provider = new QtButtonImageProvider(); + engine->addImageProvider("QtButton", provider); + } +}; + +QT_END_NAMESPACE +#endif //QTBUTTONIMAGEPROVIDERQMLPLUGIN_H diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes b/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes deleted file mode 100644 index 76ae3f9..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes +++ /dev/null @@ -1,210 +0,0 @@ -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 QtDeviceUtilities.QtButtonImageProvider 1.0' - -Module { - dependencies: [] - Component { - prototype: "QObject" - name: "QtDeviceUtilities.QtButtonImageProvider/QtButton 1.0" - exports: ["QtDeviceUtilities.QtButtonImageProvider/QtButton 1.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "state"; type: "string" } - Property { name: "cutSize"; type: "int" } - Property { name: "fillColor"; type: "QColor" } - Property { name: "borderColor"; type: "QColor" } - Property { name: "text"; type: "string" } - Signal { name: "clicked" } - Property { name: "fillMode"; type: "FillMode" } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "mipmap"; revision: 1; type: "bool" } - Property { name: "autoTransform"; revision: 2; type: "bool" } - Signal { name: "paintedGeometryChanged" } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "VAlignment" } - } - Signal { - name: "mipmapChanged" - revision: 1 - Parameter { type: "bool" } - } - Property { name: "status"; type: "Status"; isReadonly: true } - Property { name: "source"; type: "QUrl" } - Property { name: "progress"; type: "double"; isReadonly: true } - Property { name: "asynchronous"; type: "bool" } - Property { name: "cache"; type: "bool" } - Property { name: "sourceSize"; type: "QSize" } - Property { name: "mirror"; type: "bool" } - Signal { - name: "sourceChanged" - Parameter { type: "QUrl" } - } - Signal { - name: "statusChanged" - Parameter { type: "QQuickImageBase::Status" } - } - Signal { - name: "progressChanged" - Parameter { name: "progress"; type: "double" } - } - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } -} diff --git a/src/settingsui/qtbuttonimageproviderplugin/qmldir b/src/settingsui/qtbuttonimageproviderplugin/qmldir deleted file mode 100644 index 4107ed2..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module QtDeviceUtilities.QtButtonImageProvider -plugin qtbuttonimageproviderplugin -classname QtButtonImageProviderQmlPlugin diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc deleted file mode 100644 index b3b680c..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - QtButton.qml - - diff --git a/src/settingsui/settingsuiplugin/CMakeLists.txt b/src/settingsui/settingsuiplugin/CMakeLists.txt index 0f72bc0..6ab5bf7 100644 --- a/src/settingsui/settingsuiplugin/CMakeLists.txt +++ b/src/settingsui/settingsuiplugin/CMakeLists.txt @@ -1,27 +1,7 @@ ##################################################################### ## settingsuiplugin Plugin: ##################################################################### - -qt_internal_add_qml_module(settingsuiplugin - URI "QtDeviceUtilities.SettingsUI" - VERSION "${CMAKE_PROJECT_VERSION}" - CLASS_NAME SettingsUIQmlPlugin - PLUGIN_TARGET settingsuiplugin - NO_GENERATE_PLUGIN_SOURCE - NO_PLUGIN_OPTIONAL - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" - SOURCES - plugin.cpp - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick -) - -# Resources: -set(settingsui_resource_files +set(settingsui_qml_files "../common/CustomSwitch.qml" "../common/CustomTableView.qml" "../common/HandwritingModeButton.qml" @@ -40,6 +20,28 @@ set(settingsui_resource_files "SettingsDelegate.qml" "SettingsHeader.qml" "SettingsTitleItem.qml" + "pluginMain.qml" +) + +qt_internal_add_qml_module(settingsuiplugin + URI "QtDeviceUtilities.SettingsUI" + VERSION "${CMAKE_PROJECT_VERSION}" + PLUGIN_TARGET settingsuiplugin + PAST_MAJOR_VERSIONS 2 + SOURCES + plugin.cpp + plugin_p.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick + QML_FILES + ${settingsui_qml_files} +) + +# Resources: +set(settingsui_resource_files "icons/Alert_yellow_1x.png" "icons/FloatingButton_Active.png" "icons/FloatingButton_Available.png" @@ -48,7 +50,6 @@ set(settingsui_resource_files "icons/Wifi_lightgray_2x.png" "newIcons/back_icon.svg" "newIcons/network_icon.svg" - "pluginMain.qml" ) qt_internal_add_resource(settingsuiplugin "settingsui" diff --git a/src/settingsui/settingsuiplugin/icons.qrc b/src/settingsui/settingsuiplugin/icons.qrc deleted file mode 100644 index c6944ca..0000000 --- a/src/settingsui/settingsuiplugin/icons.qrc +++ /dev/null @@ -1,12 +0,0 @@ - - - icons/Alert_yellow_1x.png - icons/FloatingButton_Active.png - icons/FloatingButton_Available.png - icons/FloatingButton_Unavailable.png - icons/WifiAnim_black_2x.png - icons/Wifi_lightgray_2x.png - newIcons/back_icon.svg - newIcons/network_icon.svg - - diff --git a/src/settingsui/settingsuiplugin/plugin.cpp b/src/settingsui/settingsuiplugin/plugin.cpp index 3ea37ad..8ac64e1 100644 --- a/src/settingsui/settingsuiplugin/plugin.cpp +++ b/src/settingsui/settingsuiplugin/plugin.cpp @@ -26,17 +26,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include -#include - -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtDeviceUtilities_SettingsUI); -#endif - Q_INIT_RESOURCE(settingsui); -} - +#include "plugin_p.h" /*! \qmlmodule QtDeviceUtilities.SettingsUI \title Qt Device Utilities: Settings UI @@ -80,25 +70,3 @@ static void initResources() There is no need to import the various \c {DeviceUtilities.*} modules and to declare a custom settings UI, unless specifically required. */ - -QT_BEGIN_NAMESPACE - -class SettingsUIQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - SettingsUIQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) override - { - // @uri QtDeviceUtilities.SettingsUI - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.SettingsUI")); - qmlRegisterType(QUrl("qrc:/pluginMain.qml"), uri, 2, 0, "SettingsUI"); - } - -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/settingsui/settingsuiplugin/plugin_p.h b/src/settingsui/settingsuiplugin/plugin_p.h new file mode 100644 index 0000000..46f2119 --- /dev/null +++ b/src/settingsui/settingsuiplugin/plugin_p.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Device Utilities module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef SETTINGSUIPLUGIN_H +#define SETTINGSUIPLUGIN_H +#include +#include + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +struct SettingsUiComponent +{ + Q_GADGET + QML_NAMED_ELEMENT(SettingsUI) + QML_ADDED_IN_VERSION(2, 0) +}; + +QT_END_NAMESPACE + +#endif //SETTINGSUIPLUGIN_H diff --git a/src/settingsui/settingsuiplugin/plugins.qmltypes b/src/settingsui/settingsuiplugin/plugins.qmltypes deleted file mode 100644 index a3bdbd9..0000000 --- a/src/settingsui/settingsuiplugin/plugins.qmltypes +++ /dev/null @@ -1,32 +0,0 @@ -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 QtDeviceUtilities.SettingsUI 1.0' - -Module { - dependencies: ["QtQuick 2.8"] - Component { - prototype: "QQuickRectangle" - name: "QtDeviceUtilities.SettingsUI/SettingsUI 1.0" - exports: ["QtDeviceUtilities.SettingsUI/SettingsUI 1.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "__initialized"; type: "bool" } - Property { name: "service"; type: "QVariant" } - Property { name: "margin"; type: "int" } - Property { name: "spacing"; type: "int" } - Property { name: "titleFontSize"; type: "int" } - Property { name: "subTitleFontSize"; type: "int" } - Property { name: "valueFontSize"; type: "int" } - Property { name: "fieldHeight"; type: "int" } - Property { name: "fieldTextHeight"; type: "int" } - Property { name: "buttonHeight"; type: "int" } - Property { name: "model"; type: "QUrl" } - Signal { name: "closed" } - Method { name: "init"; type: "QVariant" } - } -} diff --git a/src/settingsui/settingsuiplugin/qmldir b/src/settingsui/settingsuiplugin/qmldir deleted file mode 100644 index 88d0e45..0000000 --- a/src/settingsui/settingsuiplugin/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.SettingsUI -plugin settingsuiplugin -classname SettingsUIQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/settingsui/settingsuiplugin/settingsui.qrc b/src/settingsui/settingsuiplugin/settingsui.qrc deleted file mode 100644 index 7c8b661..0000000 --- a/src/settingsui/settingsuiplugin/settingsui.qrc +++ /dev/null @@ -1,31 +0,0 @@ - - - pluginMain.qml - ../common/CustomTableView.qml - ../common/HandwritingModeButton.qml - ../network/AddressListEntry.qml - ../network/ComboBoxEntry.qml - ../network/EditWiredSettings.qml - ../network/IpAddressTextField.qml - ../network/NetworkDetails.qml - ../network/NetworkSettings.qml - ../network/WifiSelectorDelegate.qml - ../network/WifiSettings.qml - ../network/WifiSignalMonitor.qml - ../network/WiredSettings.qml - ../common/CustomSwitch.qml - ../network/NetworkListView.qml - ../network/PassphraseEnter.qml - SettingsHeader.qml - SettingsDelegate.qml - SettingsTitleItem.qml - icons/Alert_yellow_1x.png - icons/FloatingButton_Active.png - icons/FloatingButton_Available.png - icons/FloatingButton_Unavailable.png - icons/WifiAnim_black_2x.png - icons/Wifi_lightgray_2x.png - newIcons/back_icon.svg - newIcons/network_icon.svg - - -- cgit v1.2.3