From 234f601126ec72268a1725ae3ab869343addfde7 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 21 Jun 2018 09:51:15 +0300 Subject: Fix static build Fix all issues preventing static build: - make sure plugins are built statically by removing CONFIG += dll - add classname to all qmldirs - unify structure and the naming of all plugin classes - initialize resources in the plugins - explicitly include qtvirtualkeyboard plugin in the build Task-number: QTBUG-68988 Change-Id: I38cdbaae49dd198559be6c9fcd0b8d15a3979e4d Reviewed-by: Ville Voutilainen --- src/bluetoothsettings/bluetoothsettings.pro | 1 - src/displaysettings/displaysettings.pro | 1 - src/imports/bluetoothsettings/qmldir | 1 + src/imports/displaysettings/plugin.cpp | 2 +- src/imports/displaysettings/qmldir | 1 + src/imports/localdevice/plugin.cpp | 6 +- src/imports/localdevice/qmldir | 1 + src/imports/localesettings/plugin.cpp | 2 +- src/imports/localesettings/qmldir | 1 + src/imports/networksettings/plugin.cpp | 2 +- src/imports/networksettings/plugin.h | 2 +- src/imports/networksettings/qmldir | 1 + src/imports/timedatesettings/qmldir | 1 + src/localdevice/localdevice.pro | 1 - src/localesettings/localesettings.pro | 1 - src/networksettings/networksettings.pro | 1 - .../qtbuttonimageproviderplugin/plugin.cpp | 69 ++++++++++ .../qtbuttonimageproviderplugin/plugin.qrc | 5 - src/settingsui/qtbuttonimageproviderplugin/qmldir | 1 + .../qtbuttonimageprovider.cpp | 145 +++++++++------------ .../qtbuttonimageprovider.qrc | 5 + .../qtbuttonimageproviderplugin.pro | 5 +- src/settingsui/settingsui.pro | 5 + src/settingsui/settingsuiplugin/plugin.cpp | 103 +++++++++++++++ src/settingsui/settingsuiplugin/plugin.qrc | 40 ------ src/settingsui/settingsuiplugin/plugins.qmltypes | 32 +++++ src/settingsui/settingsuiplugin/qmldir | 2 + src/settingsui/settingsuiplugin/settingsui.qrc | 92 +++++++++++++ .../settingsuiplugin/settingsuiplugin.pro | 34 +---- .../settingsuiplugin/settingsuiplugin_plugin.cpp | 84 ------------ .../settingsuiplugin/settingsuiplugin_plugin.h | 47 ------- src/timedatesettings/timedatesettings.pro | 1 - 32 files changed, 389 insertions(+), 306 deletions(-) create mode 100644 src/settingsui/qtbuttonimageproviderplugin/plugin.cpp delete mode 100644 src/settingsui/qtbuttonimageproviderplugin/plugin.qrc create mode 100644 src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc create mode 100644 src/settingsui/settingsuiplugin/plugin.cpp delete mode 100644 src/settingsui/settingsuiplugin/plugin.qrc create mode 100644 src/settingsui/settingsuiplugin/plugins.qmltypes create mode 100644 src/settingsui/settingsuiplugin/settingsui.qrc delete mode 100644 src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp delete mode 100644 src/settingsui/settingsuiplugin/settingsuiplugin_plugin.h (limited to 'src') diff --git a/src/bluetoothsettings/bluetoothsettings.pro b/src/bluetoothsettings/bluetoothsettings.pro index cb98ccb..7f46c58 100644 --- a/src/bluetoothsettings/bluetoothsettings.pro +++ b/src/bluetoothsettings/bluetoothsettings.pro @@ -2,7 +2,6 @@ load(qt_build_config) TARGET = QtBluetoothSettings VERSION = 1.0 -CONFIG += dll warn_on QT += core bluetooth diff --git a/src/displaysettings/displaysettings.pro b/src/displaysettings/displaysettings.pro index c03168d..f19d872 100644 --- a/src/displaysettings/displaysettings.pro +++ b/src/displaysettings/displaysettings.pro @@ -2,7 +2,6 @@ load(qt_build_config) TARGET = QtDisplaySettings VERSION = 1.0 -CONFIG += dll warn_on QT = core diff --git a/src/imports/bluetoothsettings/qmldir b/src/imports/bluetoothsettings/qmldir index 3b5b45e..f0c15f5 100644 --- a/src/imports/bluetoothsettings/qmldir +++ b/src/imports/bluetoothsettings/qmldir @@ -1,3 +1,4 @@ module QtDeviceUtilities.BluetoothSettings plugin btsettingsplugin +classname BluetoothSettingsQmlPlugin typeinfo plugins.qmltypes diff --git a/src/imports/displaysettings/plugin.cpp b/src/imports/displaysettings/plugin.cpp index fd88a1a..601b8e0 100644 --- a/src/imports/displaysettings/plugin.cpp +++ b/src/imports/displaysettings/plugin.cpp @@ -93,7 +93,7 @@ QObject *instance(QQmlEngine *engine, QJSEngine *) { return t; } -class GeneralSettingsQmlPlugin : public QQmlExtensionPlugin +class DisplaySettingsQmlPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") diff --git a/src/imports/displaysettings/qmldir b/src/imports/displaysettings/qmldir index 4576519..1bfbe93 100644 --- a/src/imports/displaysettings/qmldir +++ b/src/imports/displaysettings/qmldir @@ -1,3 +1,4 @@ module QtDeviceUtilities.DisplaySettings plugin qmldisplaysettingsplugin +classname DisplaySettingsQmlPlugin typeinfo plugins.qmltypes diff --git a/src/imports/localdevice/plugin.cpp b/src/imports/localdevice/plugin.cpp index 785b364..506c6f6 100644 --- a/src/imports/localdevice/plugin.cpp +++ b/src/imports/localdevice/plugin.cpp @@ -96,16 +96,12 @@ static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine) return api; } -class B2QtUtilsPlugin : public QQmlExtensionPlugin +class LocalDeviceSettingsQmlPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - B2QtUtilsPlugin() - { - } - void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == "QtDeviceUtilities.LocalDeviceSettings"); diff --git a/src/imports/localdevice/qmldir b/src/imports/localdevice/qmldir index 1d9791b..81b12d4 100644 --- a/src/imports/localdevice/qmldir +++ b/src/imports/localdevice/qmldir @@ -1,3 +1,4 @@ module QtDeviceUtilities.LocalDeviceSettings plugin localdeviceplugin +classname LocalDeviceSettingsQmlPlugin typeinfo plugins.qmltypes diff --git a/src/imports/localesettings/plugin.cpp b/src/imports/localesettings/plugin.cpp index db90003..deaad2b 100644 --- a/src/imports/localesettings/plugin.cpp +++ b/src/imports/localesettings/plugin.cpp @@ -157,7 +157,7 @@ QObject *instance(QQmlEngine *engine, QJSEngine *) { return t; } -class LanguageSettingsQmlPlugin : public QQmlExtensionPlugin +class LocaleSettingsQmlPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") diff --git a/src/imports/localesettings/qmldir b/src/imports/localesettings/qmldir index 0110eda..0106d12 100644 --- a/src/imports/localesettings/qmldir +++ b/src/imports/localesettings/qmldir @@ -1,3 +1,4 @@ module QtDeviceUtilities.LocaleSettings plugin localesettingsplugin +classname LocaleSettingsQmlPlugin typeinfo plugins.qmltypes diff --git a/src/imports/networksettings/plugin.cpp b/src/imports/networksettings/plugin.cpp index 419b685..ee49594 100644 --- a/src/imports/networksettings/plugin.cpp +++ b/src/imports/networksettings/plugin.cpp @@ -169,7 +169,7 @@ QObject *instance(QQmlEngine *engine, QJSEngine *) { return t; } -void NetworksettingspluginPlugin::registerTypes(const char *uri) +void NetworkSettingsQmlPlugin::registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtDeviceUtilities.NetworkSettings")); qmlRegisterUncreatableType(uri, 1, 0, "NetworkService", "Cannot be instantiated directly."); diff --git a/src/imports/networksettings/plugin.h b/src/imports/networksettings/plugin.h index e5c7bc7..0cae114 100644 --- a/src/imports/networksettings/plugin.h +++ b/src/imports/networksettings/plugin.h @@ -33,7 +33,7 @@ QT_BEGIN_NAMESPACE -class NetworksettingspluginPlugin : public QQmlExtensionPlugin +class NetworkSettingsQmlPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") diff --git a/src/imports/networksettings/qmldir b/src/imports/networksettings/qmldir index e94bfe4..64b8d6e 100644 --- a/src/imports/networksettings/qmldir +++ b/src/imports/networksettings/qmldir @@ -1,3 +1,4 @@ module QtDeviceUtilities.NetworkSettings plugin networksettingsplugin +classname NetworkSettingsQmlPlugin typeinfo plugins.qmltypes diff --git a/src/imports/timedatesettings/qmldir b/src/imports/timedatesettings/qmldir index 3e99f3d..3489ac2 100644 --- a/src/imports/timedatesettings/qmldir +++ b/src/imports/timedatesettings/qmldir @@ -1,3 +1,4 @@ module QtDeviceUtilities.TimeDateSettings plugin qmltimedatesettingsplugin +classname TimeDateSettingsQmlPlugin typeinfo plugins.qmltypes diff --git a/src/localdevice/localdevice.pro b/src/localdevice/localdevice.pro index e6e5bc9..9adc183 100644 --- a/src/localdevice/localdevice.pro +++ b/src/localdevice/localdevice.pro @@ -2,7 +2,6 @@ load(qt_build_config) TARGET = QtLocalDevice VERSION = 1.0 -CONFIG += dll warn_on QT = core diff --git a/src/localesettings/localesettings.pro b/src/localesettings/localesettings.pro index 808477d..7f5f98a 100644 --- a/src/localesettings/localesettings.pro +++ b/src/localesettings/localesettings.pro @@ -2,7 +2,6 @@ load(qt_build_config) TARGET = QtLocaleSettings VERSION = 1.0 -CONFIG += dll warn_on QT = core dbus diff --git a/src/networksettings/networksettings.pro b/src/networksettings/networksettings.pro index db2ce06..1704f4e 100644 --- a/src/networksettings/networksettings.pro +++ b/src/networksettings/networksettings.pro @@ -2,7 +2,6 @@ load(qt_build_config) TARGET = QtNetworkSettings VERSION = 1.0 -CONFIG += dll warn_on QT = core network diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp new file mode 100644 index 0000000..7245feb --- /dev/null +++ b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ +#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) + { + 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) + { + Q_UNUSED(uri); + QtButtonImageProvider *provider = new QtButtonImageProvider(); + engine->addImageProvider("QtButton", provider); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.qrc b/src/settingsui/qtbuttonimageproviderplugin/plugin.qrc deleted file mode 100644 index b3b680c..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/plugin.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - QtButton.qml - - diff --git a/src/settingsui/qtbuttonimageproviderplugin/qmldir b/src/settingsui/qtbuttonimageproviderplugin/qmldir index 5567d74..4107ed2 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/qmldir +++ b/src/settingsui/qtbuttonimageproviderplugin/qmldir @@ -1,2 +1,3 @@ module QtDeviceUtilities.QtButtonImageProvider plugin qtbuttonimageproviderplugin +classname QtButtonImageProviderQmlPlugin diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp index 3879d9b..a3649bb 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp +++ b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp @@ -26,102 +26,75 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include -#include #include #include #include -class QtButtonImageProvider : public QQuickImageProvider -{ -public: - QtButtonImageProvider() - : QQuickImageProvider(QQuickImageProvider::Pixmap) - { - } - - QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) - { - bool ok = false; - - QStringList params = id.split("/"); - - int cutSize = params.at(0).toInt(&ok); - - if (!ok) - cutSize = 10; - - QColor fillColor; - QColor borderColor; - - if (params.length() > 1) { - fillColor = QColor(params.at(1)); - } - - if (params.length() > 2) - borderColor = QColor(params.at(2)); +#include "qtbuttonimageprovider.h" - if (!fillColor.isValid()) - fillColor = "#00eb00"; - - if (!borderColor.isValid()) - borderColor ="white"; - - int width = 100; - int height = 50; - - if (size) - *size = QSize(requestedSize.width(), requestedSize.height()); +QtButtonImageProvider::QtButtonImageProvider() + : QQuickImageProvider(QQuickImageProvider::Pixmap) +{ +} - QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width, - requestedSize.height() > 0 ? requestedSize.height() : height); - pixmap.fill(Qt::transparent); +QPixmap QtButtonImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) +{ + bool ok = false; - QPainter painter(&pixmap); - const qreal borderPenWidth = 2; - QPen borderPen(QBrush(borderColor), borderPenWidth); - borderPen.setJoinStyle(Qt::MiterJoin); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(borderPen); - painter.setBrush(fillColor); + QStringList params = id.split("/"); - QPainterPath path; - qreal top = borderPenWidth - 1; - qreal left = borderPenWidth - 1; - qreal bottom = pixmap.height() - borderPenWidth; - qreal right = pixmap.width() - borderPenWidth; - path.moveTo(left + cutSize, top); - path.lineTo(right, top); - path.lineTo(right, bottom - cutSize); - path.lineTo(right - cutSize, bottom); - path.lineTo(left, bottom); - path.lineTo(left, top + cutSize); - path.lineTo(left + cutSize, top); - painter.drawPath(path); + int cutSize = params.at(0).toInt(&ok); - return pixmap; - } -}; + if (!ok) + cutSize = 10; -class ImageProviderExtensionPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - void registerTypes(const char *uri) - { - Q_UNUSED(uri) - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.QtButtonImageProvider")); - qmlRegisterType(QUrl("qrc:/QtButton.qml"), uri, 1, 0, "QtButton"); - } + QColor fillColor; + QColor borderColor; - void initializeEngine(QQmlEngine *engine, const char *uri) - { - Q_UNUSED(uri); - QtButtonImageProvider *provider = new QtButtonImageProvider(); - engine->addImageProvider("QtButton", provider); + if (params.length() > 1) { + fillColor = QColor(params.at(1)); } -}; -#include "qtbuttonimageprovider.moc" + if (params.length() > 2) + borderColor = QColor(params.at(2)); + + if (!fillColor.isValid()) + fillColor = "#00eb00"; + + if (!borderColor.isValid()) + borderColor ="white"; + + int width = 100; + int height = 50; + + if (size) + *size = QSize(requestedSize.width(), requestedSize.height()); + + QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width, + requestedSize.height() > 0 ? requestedSize.height() : height); + pixmap.fill(Qt::transparent); + + QPainter painter(&pixmap); + const qreal borderPenWidth = 2; + QPen borderPen(QBrush(borderColor), borderPenWidth); + borderPen.setJoinStyle(Qt::MiterJoin); + painter.setRenderHint(QPainter::Antialiasing, true); + painter.setPen(borderPen); + painter.setBrush(fillColor); + + QPainterPath path; + qreal top = borderPenWidth - 1; + qreal left = borderPenWidth - 1; + qreal bottom = pixmap.height() - borderPenWidth; + qreal right = pixmap.width() - borderPenWidth; + path.moveTo(left + cutSize, top); + path.lineTo(right, top); + path.lineTo(right, bottom - cutSize); + path.lineTo(right - cutSize, bottom); + path.lineTo(left, bottom); + path.lineTo(left, top + cutSize); + path.lineTo(left + cutSize, top); + painter.drawPath(path); + + return pixmap; +} diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc new file mode 100644 index 0000000..b3b680c --- /dev/null +++ b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc @@ -0,0 +1,5 @@ + + + QtButton.qml + + diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro index 8383a75..2cba61b 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro +++ b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro @@ -5,12 +5,13 @@ TARGET = qtbuttonimageproviderplugin TARGETPATH = QtDeviceUtilities/QtButtonImageProvider SOURCES += \ - qtbuttonimageprovider.cpp + qtbuttonimageprovider.cpp \ + plugin.cpp HEADERS += \ qtbuttonimageprovider.h RESOURCES += \ - plugin.qrc + qtbuttonimageprovider.qrc load(qml_plugin) diff --git a/src/settingsui/settingsui.pro b/src/settingsui/settingsui.pro index 51b6dca..b20b548 100644 --- a/src/settingsui/settingsui.pro +++ b/src/settingsui/settingsui.pro @@ -11,3 +11,8 @@ QML_IMPORT_PATH = # Default rules for deployment. include(deployment.pri) + +static { + QTPLUGIN += qtvirtualkeyboardplugin + QT += svg +} diff --git a/src/settingsui/settingsuiplugin/plugin.cpp b/src/settingsui/settingsuiplugin/plugin.cpp new file mode 100644 index 0000000..504e4ed --- /dev/null +++ b/src/settingsui/settingsuiplugin/plugin.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ +#include +#include + +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtDeviceUtilities_SettingsUI); +#endif + Q_INIT_RESOURCE(settingsui); +} + +/*! + \qmlmodule QtDeviceUtilities.SettingsUI 1.0 + \title Qt Device Utilities: Settings UI + \ingroup qtee-qmlmodules + \brief Provides a system-wide settings UI. + + The \c DeviceUtilities.SettingsUI module provides a single QML type, + SettingsUI, that allows applications to integrate a standard, system-wide + settings view into their user interface. + + Import the module as follows: + + \badcode + import QtDeviceUtilities.SettingsUI 1.0 + \endcode + + \section1 QML Types +*/ + +/*! + \qmltype SettingsUI + \inqmlmodule QtDeviceUtilities.SettingsUI + \brief Provides a QML type for displaying a system-wide settings UI. + + With the SettingsUI type, applications can easily integrate a standard, + system-wide settings view into their user interface. + + For example: + + \qml + import QtQuick 2.6 + import QtDeviceUtilities.SettingsUI 1.0 + + SettingsUI { + id: settingsUI + anchors.fill: parent + } + \endqml + + 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, 1, 0, "SettingsUI"); + } + +}; + +QT_END_NAMESPACE + +#include "plugin.moc" diff --git a/src/settingsui/settingsuiplugin/plugin.qrc b/src/settingsui/settingsuiplugin/plugin.qrc deleted file mode 100644 index e6d02ea..0000000 --- a/src/settingsui/settingsuiplugin/plugin.qrc +++ /dev/null @@ -1,40 +0,0 @@ - - - pluginMain.qml - ../bluetooth/Bluetooth.qml - ../bluetooth/Discovery.qml - ../common/CustomTableView.qml - ../common/HandwritingModeButton.qml - ../display/Display.qml - ../locale/Language.qml - ../locale/RegionSelect.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 - ../timedate/AnalogClock.qml - ../timedate/ClockHand.qml - ../timedate/CustomCalendar.qml - ../timedate/TimeDate.qml - ../timedate/TimezonesView.qml - settingsview.xml - ../power/Power.qml - ../timedate/ManualTime.qml - ../timedate/CustomComboBox.qml - ../common/CustomSwitch.qml - ../network/NetworkListView.qml - ../network/PassphraseEnter.qml - ../locale/TableKey.qml - ../locale/TableValue.qml - SettingsHeader.qml - SettingsDelegate.qml - SettingsTitleItem.qml - ShutdownPopup.qml - - diff --git a/src/settingsui/settingsuiplugin/plugins.qmltypes b/src/settingsui/settingsuiplugin/plugins.qmltypes new file mode 100644 index 0000000..a3bdbd9 --- /dev/null +++ b/src/settingsui/settingsuiplugin/plugins.qmltypes @@ -0,0 +1,32 @@ +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 index 542b7fe..88d0e45 100644 --- a/src/settingsui/settingsuiplugin/qmldir +++ b/src/settingsui/settingsuiplugin/qmldir @@ -1,2 +1,4 @@ module QtDeviceUtilities.SettingsUI plugin settingsuiplugin +classname SettingsUIQmlPlugin +typeinfo plugins.qmltypes diff --git a/src/settingsui/settingsuiplugin/settingsui.qrc b/src/settingsui/settingsuiplugin/settingsui.qrc new file mode 100644 index 0000000..ad2a9b6 --- /dev/null +++ b/src/settingsui/settingsuiplugin/settingsui.qrc @@ -0,0 +1,92 @@ + + + pluginMain.qml + ../bluetooth/Bluetooth.qml + ../bluetooth/Discovery.qml + ../common/CustomTableView.qml + ../common/HandwritingModeButton.qml + ../display/Display.qml + ../locale/Language.qml + ../locale/RegionSelect.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 + ../timedate/AnalogClock.qml + ../timedate/ClockHand.qml + ../timedate/CustomCalendar.qml + ../timedate/TimeDate.qml + ../timedate/TimezonesView.qml + settingsview.xml + ../power/Power.qml + ../timedate/ManualTime.qml + ../timedate/CustomComboBox.qml + ../common/CustomSwitch.qml + ../network/NetworkListView.qml + ../network/PassphraseEnter.qml + ../locale/TableKey.qml + ../locale/TableValue.qml + SettingsHeader.qml + SettingsDelegate.qml + SettingsTitleItem.qml + ShutdownPopup.qml + icons/Alert_yellow_1x.png + icons/Audio_qt_6x.png + icons/Bluetooth_qt_1x.png + icons/Bluetooth_qt_6x.png + icons/Camcorder_qt_1x.png + icons/Camera_qt_1x.png + icons/Clock_qt_1x.png + icons/Clock_qt_6x.png + icons/Display_qt_6x.png + icons/Flag_qt_6x.png + icons/FloatingButton_Active.png + icons/FloatingButton_Available.png + icons/FloatingButton_Unavailable.png + icons/Headphones_qt_1x.png + icons/Heartbeat_qt_1x.png + icons/Keyboard_qt_1x.png + icons/Laptop_qt_1x.png + icons/Microphone_qt_1x.png + icons/MobilePhone_qt_1x.png + icons/Mouse_qt_1x.png + icons/Tablet_qt_1x.png + icons/Volume_down_qt_1x.png + icons/Volume_mute_qt_1x.png + icons/Volume_up_qt_1x.png + icons/WifiAnim_black_2x.png + icons/Wifi_lightgray_2x.png + icons/World_qt_6x.png + icons/Chevron-left_black_6x.png + icons/Chevron-left_black.png + icons/Power_black_6x.png + newIcons/back_icon.svg + newIcons/bluetooth_icon.svg + newIcons/close_icon.svg + newIcons/date-time_icon.svg + newIcons/detail_icon.svg + newIcons/display_icon.svg + newIcons/grid_icon.svg + newIcons/header_toggle_icon.svg + newIcons/info_icon.svg + newIcons/language_icon.svg + newIcons/mouse_icon.svg + newIcons/mute_icon.svg + newIcons/network_icon.svg + newIcons/pause_icon.svg + newIcons/play_icon.svg + newIcons/power_icon.svg + newIcons/settings_icon.svg + newIcons/settingsmenu_launcher_icon.svg + newIcons/stop_icon.svg + newIcons/touch_icon.svg + newIcons/volume_icon.svg + newIcons/qt_logo_green_rgb.svg + + diff --git a/src/settingsui/settingsuiplugin/settingsuiplugin.pro b/src/settingsui/settingsuiplugin/settingsuiplugin.pro index 4e2b67d..6b8a3af 100644 --- a/src/settingsui/settingsuiplugin/settingsuiplugin.pro +++ b/src/settingsui/settingsuiplugin/settingsuiplugin.pro @@ -1,36 +1,16 @@ -TEMPLATE = lib -TARGET = settingsuiplugin QT += qml quick -CONFIG += plugin c++11 +CONFIG += no_cxx_module -TARGET = $$qtLibraryTarget($$TARGET) -uri = QtDeviceUtilities.SettingsUI +TARGET = settingsuiplugin +TARGETPATH = QtDeviceUtilities/SettingsUI -# Input SOURCES += \ - settingsuiplugin_plugin.cpp - -HEADERS += \ - settingsuiplugin_plugin.h + plugin.cpp DISTFILES += \ qmldir -!equals(_PRO_FILE_PWD_, $$OUT_PWD) { - copy_qmldir.target = $$OUT_PWD/qmldir - copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir - copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" - QMAKE_EXTRA_TARGETS += copy_qmldir - PRE_TARGETDEPS += $$copy_qmldir.target -} - -qmldir.files = qmldir - -installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) -qmldir.path = $$installPath -target.path = $$installPath -INSTALLS += target qmldir - RESOURCES += \ - icons.qrc \ - plugin.qrc + settingsui.qrc + +load(qml_plugin) diff --git a/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp b/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp deleted file mode 100644 index b985e31..0000000 --- a/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp +++ /dev/null @@ -1,84 +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$ -** -****************************************************************************/ -#include "settingsuiplugin_plugin.h" -#include - -/*! - \qmlmodule QtDeviceUtilities.SettingsUI 1.0 - \title Qt Device Utilities: Settings UI - \ingroup qtee-qmlmodules - \brief Provides a system-wide settings UI. - - The \c DeviceUtilities.SettingsUI module provides a single QML type, - SettingsUI, that allows applications to integrate a standard, system-wide - settings view into their user interface. - - Import the module as follows: - - \badcode - import QtDeviceUtilities.SettingsUI 1.0 - \endcode - - \section1 QML Types -*/ - -/*! - \qmltype SettingsUI - \inqmlmodule QtDeviceUtilities.SettingsUI - \brief Provides a QML type for displaying a system-wide settings UI. - - With the SettingsUI type, applications can easily integrate a standard, - system-wide settings view into their user interface. - - For example: - - \qml - import QtQuick 2.6 - import QtDeviceUtilities.SettingsUI 1.0 - - SettingsUI { - id: settingsUI - anchors.fill: parent - } - \endqml - - There is no need to import the various \c {DeviceUtilities.*} modules and - to declare a custom settings UI, unless specifically required. -*/ - -QT_BEGIN_NAMESPACE - -void SettingsuipluginPlugin::registerTypes(const char *uri) -{ - // @uri QtDeviceUtilities.SettingsUI - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.SettingsUI")); - qmlRegisterType(QUrl("qrc:/pluginMain.qml"), uri, 1, 0, "SettingsUI"); -} - -QT_END_NAMESPACE diff --git a/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.h b/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.h deleted file mode 100644 index 32a92b5..0000000 --- a/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.h +++ /dev/null @@ -1,47 +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 SETTINGSUIPLUGIN_PLUGIN_H -#define SETTINGSUIPLUGIN_PLUGIN_H - -#include - -QT_BEGIN_NAMESPACE - -class SettingsuipluginPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri); -}; - -QT_END_NAMESPACE - -#endif // SETTINGSUIPLUGIN_PLUGIN_H diff --git a/src/timedatesettings/timedatesettings.pro b/src/timedatesettings/timedatesettings.pro index 6f3f4e9..6c35777 100644 --- a/src/timedatesettings/timedatesettings.pro +++ b/src/timedatesettings/timedatesettings.pro @@ -2,7 +2,6 @@ load(qt_build_config) TARGET = QtTimeDateSettings VERSION = 1.0 -CONFIG += dll warn_on QT = core dbus -- cgit v1.2.3