diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2018-06-21 09:51:15 +0300 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2018-06-26 14:07:38 +0000 |
commit | 234f601126ec72268a1725ae3ab869343addfde7 (patch) | |
tree | df1d9b9ef7fdf9245620e86789b9ea05c7e8e45d /src/settingsui/settingsuiplugin | |
parent | 3ced5d94d2ea89b6951f80e5b4307ac6b0b34dae (diff) |
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 <ville.voutilainen@qt.io>
Diffstat (limited to 'src/settingsui/settingsuiplugin')
-rw-r--r-- | src/settingsui/settingsuiplugin/plugin.cpp (renamed from src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp) | 33 | ||||
-rw-r--r-- | src/settingsui/settingsuiplugin/plugin.qrc | 40 | ||||
-rw-r--r-- | src/settingsui/settingsuiplugin/plugins.qmltypes | 32 | ||||
-rw-r--r-- | src/settingsui/settingsuiplugin/qmldir | 2 | ||||
-rw-r--r-- | src/settingsui/settingsuiplugin/settingsui.qrc | 92 | ||||
-rw-r--r-- | src/settingsui/settingsuiplugin/settingsuiplugin.pro | 34 | ||||
-rw-r--r-- | src/settingsui/settingsuiplugin/settingsuiplugin_plugin.h | 47 |
7 files changed, 159 insertions, 121 deletions
diff --git a/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp b/src/settingsui/settingsuiplugin/plugin.cpp index b985e31..504e4ed 100644 --- a/src/settingsui/settingsuiplugin/settingsuiplugin_plugin.cpp +++ b/src/settingsui/settingsuiplugin/plugin.cpp @@ -26,8 +26,16 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "settingsuiplugin_plugin.h" -#include <qqml.h> +#include <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> + +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtDeviceUtilities_SettingsUI); +#endif + Q_INIT_RESOURCE(settingsui); +} /*! \qmlmodule QtDeviceUtilities.SettingsUI 1.0 @@ -74,11 +82,22 @@ QT_BEGIN_NAMESPACE -void SettingsuipluginPlugin::registerTypes(const char *uri) +class SettingsUIQmlPlugin : public QQmlExtensionPlugin { - // @uri QtDeviceUtilities.SettingsUI - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.SettingsUI")); - qmlRegisterType(QUrl("qrc:/pluginMain.qml"), uri, 1, 0, "SettingsUI"); -} + 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 @@ -<RCC> - <qresource prefix="/"> - <file>pluginMain.qml</file> - <file>../bluetooth/Bluetooth.qml</file> - <file>../bluetooth/Discovery.qml</file> - <file>../common/CustomTableView.qml</file> - <file>../common/HandwritingModeButton.qml</file> - <file>../display/Display.qml</file> - <file>../locale/Language.qml</file> - <file>../locale/RegionSelect.qml</file> - <file>../network/AddressListEntry.qml</file> - <file>../network/ComboBoxEntry.qml</file> - <file>../network/EditWiredSettings.qml</file> - <file>../network/IpAddressTextField.qml</file> - <file>../network/NetworkDetails.qml</file> - <file>../network/NetworkSettings.qml</file> - <file>../network/WifiSelectorDelegate.qml</file> - <file>../network/WifiSettings.qml</file> - <file>../network/WifiSignalMonitor.qml</file> - <file>../network/WiredSettings.qml</file> - <file>../timedate/AnalogClock.qml</file> - <file>../timedate/ClockHand.qml</file> - <file>../timedate/CustomCalendar.qml</file> - <file>../timedate/TimeDate.qml</file> - <file>../timedate/TimezonesView.qml</file> - <file>settingsview.xml</file> - <file>../power/Power.qml</file> - <file>../timedate/ManualTime.qml</file> - <file>../timedate/CustomComboBox.qml</file> - <file>../common/CustomSwitch.qml</file> - <file>../network/NetworkListView.qml</file> - <file>../network/PassphraseEnter.qml</file> - <file>../locale/TableKey.qml</file> - <file>../locale/TableValue.qml</file> - <file>SettingsHeader.qml</file> - <file>SettingsDelegate.qml</file> - <file>SettingsTitleItem.qml</file> - <file>ShutdownPopup.qml</file> - </qresource> -</RCC> 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 @@ +<RCC> + <qresource prefix="/"> + <file>pluginMain.qml</file> + <file>../bluetooth/Bluetooth.qml</file> + <file>../bluetooth/Discovery.qml</file> + <file>../common/CustomTableView.qml</file> + <file>../common/HandwritingModeButton.qml</file> + <file>../display/Display.qml</file> + <file>../locale/Language.qml</file> + <file>../locale/RegionSelect.qml</file> + <file>../network/AddressListEntry.qml</file> + <file>../network/ComboBoxEntry.qml</file> + <file>../network/EditWiredSettings.qml</file> + <file>../network/IpAddressTextField.qml</file> + <file>../network/NetworkDetails.qml</file> + <file>../network/NetworkSettings.qml</file> + <file>../network/WifiSelectorDelegate.qml</file> + <file>../network/WifiSettings.qml</file> + <file>../network/WifiSignalMonitor.qml</file> + <file>../network/WiredSettings.qml</file> + <file>../timedate/AnalogClock.qml</file> + <file>../timedate/ClockHand.qml</file> + <file>../timedate/CustomCalendar.qml</file> + <file>../timedate/TimeDate.qml</file> + <file>../timedate/TimezonesView.qml</file> + <file>settingsview.xml</file> + <file>../power/Power.qml</file> + <file>../timedate/ManualTime.qml</file> + <file>../timedate/CustomComboBox.qml</file> + <file>../common/CustomSwitch.qml</file> + <file>../network/NetworkListView.qml</file> + <file>../network/PassphraseEnter.qml</file> + <file>../locale/TableKey.qml</file> + <file>../locale/TableValue.qml</file> + <file>SettingsHeader.qml</file> + <file>SettingsDelegate.qml</file> + <file>SettingsTitleItem.qml</file> + <file>ShutdownPopup.qml</file> + <file>icons/Alert_yellow_1x.png</file> + <file>icons/Audio_qt_6x.png</file> + <file>icons/Bluetooth_qt_1x.png</file> + <file>icons/Bluetooth_qt_6x.png</file> + <file>icons/Camcorder_qt_1x.png</file> + <file>icons/Camera_qt_1x.png</file> + <file>icons/Clock_qt_1x.png</file> + <file>icons/Clock_qt_6x.png</file> + <file>icons/Display_qt_6x.png</file> + <file>icons/Flag_qt_6x.png</file> + <file>icons/FloatingButton_Active.png</file> + <file>icons/FloatingButton_Available.png</file> + <file>icons/FloatingButton_Unavailable.png</file> + <file>icons/Headphones_qt_1x.png</file> + <file>icons/Heartbeat_qt_1x.png</file> + <file>icons/Keyboard_qt_1x.png</file> + <file>icons/Laptop_qt_1x.png</file> + <file>icons/Microphone_qt_1x.png</file> + <file>icons/MobilePhone_qt_1x.png</file> + <file>icons/Mouse_qt_1x.png</file> + <file>icons/Tablet_qt_1x.png</file> + <file>icons/Volume_down_qt_1x.png</file> + <file>icons/Volume_mute_qt_1x.png</file> + <file>icons/Volume_up_qt_1x.png</file> + <file>icons/WifiAnim_black_2x.png</file> + <file>icons/Wifi_lightgray_2x.png</file> + <file>icons/World_qt_6x.png</file> + <file>icons/Chevron-left_black_6x.png</file> + <file>icons/Chevron-left_black.png</file> + <file>icons/Power_black_6x.png</file> + <file>newIcons/back_icon.svg</file> + <file>newIcons/bluetooth_icon.svg</file> + <file>newIcons/close_icon.svg</file> + <file>newIcons/date-time_icon.svg</file> + <file>newIcons/detail_icon.svg</file> + <file>newIcons/display_icon.svg</file> + <file>newIcons/grid_icon.svg</file> + <file>newIcons/header_toggle_icon.svg</file> + <file>newIcons/info_icon.svg</file> + <file>newIcons/language_icon.svg</file> + <file>newIcons/mouse_icon.svg</file> + <file>newIcons/mute_icon.svg</file> + <file>newIcons/network_icon.svg</file> + <file>newIcons/pause_icon.svg</file> + <file>newIcons/play_icon.svg</file> + <file>newIcons/power_icon.svg</file> + <file>newIcons/settings_icon.svg</file> + <file>newIcons/settingsmenu_launcher_icon.svg</file> + <file>newIcons/stop_icon.svg</file> + <file>newIcons/touch_icon.svg</file> + <file>newIcons/volume_icon.svg</file> + <file>newIcons/qt_logo_green_rgb.svg</file> + </qresource> +</RCC> 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.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 <QQmlExtensionPlugin> - -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 |