diff options
60 files changed, 538 insertions, 520 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fd523a..090928a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,8 @@ project(QtDeviceUtilities LANGUAGES CXX C ) -find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals) -find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick DBus) +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) +find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Network Quick Qml QuickControls2 DBus) macro(assertTargets) foreach(qtTarget IN ITEMS ${ARGN}) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..dcb8cf0 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,5 @@ +qt_examples_build_begin(EXTERNAL_BUILD) + +add_subdirectory(deviceutilities) + +qt_examples_build_end() diff --git a/examples/deviceutilities/CMakeLists.txt b/examples/deviceutilities/CMakeLists.txt new file mode 100644 index 0000000..1704ea5 --- /dev/null +++ b/examples/deviceutilities/CMakeLists.txt @@ -0,0 +1,3 @@ +if(TARGET Qt::Quick) + add_subdirectory(settingsuiapp) +endif() diff --git a/src/settingsui/AutoScroller.qml b/examples/deviceutilities/settingsuiapp/AutoScroller.qml index e1d5c27..e1d5c27 100644 --- a/src/settingsui/AutoScroller.qml +++ b/examples/deviceutilities/settingsuiapp/AutoScroller.qml diff --git a/examples/deviceutilities/settingsuiapp/CMakeLists.txt b/examples/deviceutilities/settingsuiapp/CMakeLists.txt new file mode 100644 index 0000000..3a5fe87 --- /dev/null +++ b/examples/deviceutilities/settingsuiapp/CMakeLists.txt @@ -0,0 +1,56 @@ +cmake_minimum_required(VERSION 3.19) + +project(settingsapp VERSION 1.0 LANGUAGES CXX) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "${CMAKE_INSTALL_PREFIX}/share/examples") +endif() +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/deviceutilities/settingsapp") + +set(CMAKE_AUTOMOC ON) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 COMPONENTS Core Qml Quick) + +add_subdirectory(DeviceUtilities/SettingsUI) +add_subdirectory(DeviceUtilities/QtButtonImageProvider) + +set(qml_files + "main.qml" + "AutoScroller.qml" + "HandwritingModeButton.qml" +) + +set(images + "images/FloatingButton_Active.png" + "images/FloatingButton_Available.png" + "images/FloatingButton_Unavailable.png" +) + +qt_add_executable(settingsapp + main.cpp +) + +qt_add_qml_module(settingsapp + URI DeviceUtilities + VERSION 1.0 + QML_FILES + ${qml_files} + SOURCES + applicationsettings.cpp + applicationsettings.h + RESOURCES + ${images} +) + +target_link_libraries(settingsapp PRIVATE + Qt::Core + Qt::Gui +) + +install(TARGETS settingsapp + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/CMakeLists.txt b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/CMakeLists.txt new file mode 100644 index 0000000..9e62cda --- /dev/null +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/CMakeLists.txt @@ -0,0 +1,32 @@ +# There are a number of options to qt_add_qml_module that start with capital NO. +# The most prominent NO option is probably NO_GENERATE_PLUGIN_SOURCE. +# Unfortunately image providers still need to be configured per QML engine. +# Therefore, if you bundle an image provider in your QML module, you need to implement +# the QQmlEngineExtensionPlugin::initializeEngine() method. +# This, in turn, makes it necessary to write your own plugin. +# In this example the plugin is in the QtButtonImageProvider class. + +qt_add_qml_module(qtbuttonimageproviderplugin + URI "DeviceUtilities.QtButtonImageProvider" + VERSION 1.0 + PLUGIN_TARGET qtbuttonimageproviderplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + CLASS_NAME QtButtonImageProviderPlugin + SOURCES + plugin.cpp plugin_p.h + qtbuttonimageprovider.cpp qtbuttonimageprovider.h + QML_FILES + "QtButton.qml" +) + +target_link_libraries(qtbuttonimageproviderplugin PRIVATE + Qt::Quick +) + +install(TARGETS qtbuttonimageproviderplugin + DESTINATION "${INSTALL_EXAMPLEDIR}/DeviceUtilities/QtButtonImageProvider" +) +install(FILES $<TARGET_FILE_DIR:qtbuttonimageproviderplugin>/qmldir + DESTINATION "${INSTALL_EXAMPLEDIR}/DeviceUtilities/QtButtonImageProvider" +) diff --git a/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/QtButton.qml index d65ae23..60e16ff 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/QtButton.qml @@ -27,6 +27,7 @@ ** ****************************************************************************/ import QtQuick +import DeviceUtilities.SettingsUI Image { id: root @@ -34,9 +35,10 @@ Image { sourceSize: Qt.size(width, height) property string state: "enabled" property int cutSize: 10 - property color fillColor: viewSettings.buttonGreenColor - property color borderColor: mouseArea.pressed ? viewSettings.buttonActiveColor : viewSettings.buttonGreenColor + property color fillColor: Globals.buttonGreenColor + property color borderColor: mouseArea.pressed ? Globals.buttonActiveColor : Globals.buttonGreenColor property alias text: buttonText.text + property alias fontFamily: buttonText.font.family signal clicked() width: buttonText.contentWidth + cutSize * 4 @@ -52,7 +54,7 @@ Image { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter font.pixelSize: parent.height * 0.65 - font.family: appFont + //font.family: Globals.appFont color: "white" } } diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/plugin.cpp index 30ede2a..30ede2a 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/plugin.cpp diff --git a/src/settingsui/settingsuiplugin/plugin_p.h b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/plugin_p.h index 46f2119..96f64ad 100644 --- a/src/settingsui/settingsuiplugin/plugin_p.h +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/plugin_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -26,10 +26,11 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef SETTINGSUIPLUGIN_H -#define SETTINGSUIPLUGIN_H +#ifndef QTBUTTONIMAGEPROVIDERQMLPLUGIN_H +#define QTBUTTONIMAGEPROVIDERQMLPLUGIN_H + +#include "qtbuttonimageprovider.h" #include <qqmlextensionplugin.h> -#include <qqmlengine.h> // // W A R N I N G @@ -44,13 +45,18 @@ QT_BEGIN_NAMESPACE -struct SettingsUiComponent +class QtButtonImageProviderQmlPlugin : public QQmlEngineExtensionPlugin { - Q_GADGET - QML_NAMED_ELEMENT(SettingsUI) - QML_ADDED_IN_VERSION(2, 0) + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + void initializeEngine(QQmlEngine *engine, const char *uri) final + { + Q_UNUSED(uri); + engine->addImageProvider("QtButton", new QtButtonImageProvider); + } }; QT_END_NAMESPACE - -#endif //SETTINGSUIPLUGIN_H +#endif //QTBUTTONIMAGEPROVIDERQMLPLUGIN_H diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/qtbuttonimageprovider.cpp index 5bf162b..65566a5 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/qtbuttonimageprovider.cpp @@ -26,7 +26,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include <QQuickImageProvider> #include <QImage> #include <QPainter> #include <QPainterPath> diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/qtbuttonimageprovider.h index 94f410e..94f410e 100644 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/QtButtonImageProvider/qtbuttonimageprovider.h diff --git a/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/CMakeLists.txt b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/CMakeLists.txt new file mode 100644 index 0000000..c14398d --- /dev/null +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/CMakeLists.txt @@ -0,0 +1,53 @@ +set(qml_files + "Globals.qml" + "SettingsDelegate.qml" + "SettingsHeader.qml" + "SettingsTitleItem.qml" + "SettingsUI.qml" +) + +# Resources: +set(images + "icons/back.svg" + "icons/network.svg" +) + +set_source_files_properties(Globals.qml + PROPERTIES + QT_QML_SINGLETON_TYPE true +) + +find_package(Qt6 COMPONENTS NetworkSettings QuickControls2) + +add_subdirectory(Network) + +qt_add_qml_module(settingsui + URI "DeviceUtilities.SettingsUI" + VERSION 1.0 + QML_FILES + ${qml_files} + RESOURCES + ${images} +) + +target_link_libraries(settingsui PRIVATE + Qt::NetworkSettings + Qt::QuickControls2 +) + +set_target_properties(settingsuiplugin PROPERTIES + INSTALL_RPATH $ORIGIN/../..:$ORIGIN/../../${CMAKE_INSTALL_LIBDIR} +) + +install(TARGETS settingsui + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) + +install(TARGETS settingsuiplugin + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}/DeviceUtilities/SettingsUI" +) +install(FILES $<TARGET_FILE_DIR:settingsuiplugin>/qmldir + DESTINATION "${INSTALL_EXAMPLEDIR}/DeviceUtilities/SettingsUI" +) diff --git a/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Globals.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Globals.qml new file mode 100644 index 0000000..cea47d0 --- /dev/null +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Globals.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Device Creation. +** +** $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$ +** +****************************************************************************/ +pragma Singleton +import QtQuick + +QtObject { + id: globals + readonly property string appFont: "TitilliumWeb" + readonly property color backgroundColor: "#09102b" + readonly property color borderColor: "#9d9faa" + readonly property color buttonGreenColor: "#41cd52" + readonly property color buttonGrayColor: "#9d9faa" + readonly property color buttonActiveColor: "#216729" + readonly property color scrollBarColor: "#41cd52" + + readonly property real spacing: 0.5 + readonly property real titleFontSize: 0.04 + readonly property real subTitleFontSize: 0.035 + readonly property real valueFontSize: 0.025 + readonly property real fieldHeight: 0.07 + readonly property real fieldTextHeight: 0.05 + readonly property real buttonHeight: 0.05 + + function margin(width) { + return (width / 3 * 2) * 0.05; + } +} diff --git a/src/settingsui/network/AddressListEntry.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/AddressListEntry.qml index 9701587..9701587 100644 --- a/src/settingsui/network/AddressListEntry.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/AddressListEntry.qml diff --git a/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CMakeLists.txt b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CMakeLists.txt new file mode 100644 index 0000000..183c9fb --- /dev/null +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CMakeLists.txt @@ -0,0 +1,56 @@ +set(qml_files + "CustomSwitch.qml" + "CustomTableView.qml" + "AddressListEntry.qml" + "ComboBoxEntry.qml" + "EditWiredSettings.qml" + "IpAddressTextField.qml" + "NetworkDetails.qml" + "NetworkListView.qml" + "NetworkSettings.qml" + "PassphraseEnter.qml" + "WifiSelectorDelegate.qml" + "WifiSettings.qml" + "WifiSignalMonitor.qml" + "WiredSettings.qml" +) + +# Resources: +set(images + "icons/Alert_yellow_1x.png" + "icons/WifiAnim_black_2x.png" + "icons/Wifi_lightgray_2x.png" +) + +find_package(Qt6 COMPONENTS NetworkSettings QuickControls2) + +qt_add_qml_module(settingsuinetwork + URI "DeviceUtilities.SettingsUI.Network" + VERSION 1.0 + QML_FILES + ${qml_files} + RESOURCES + ${images} +) + +target_link_libraries(settingsuinetwork PRIVATE + Qt::NetworkSettings + Qt::QuickControls2 +) + +set_target_properties(settingsuinetworkplugin PROPERTIES + INSTALL_RPATH $ORIGIN/../../..:$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR} +) + +install(TARGETS settingsuinetwork + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) + +install(TARGETS settingsuinetworkplugin + DESTINATION "${INSTALL_EXAMPLEDIR}/DeviceUtilities/SettingsUI/Network" +) +install(FILES $<TARGET_FILE_DIR:settingsuinetworkplugin>/qmldir + DESTINATION "${INSTALL_EXAMPLEDIR}/DeviceUtilities/SettingsUI/Network" +) diff --git a/src/settingsui/network/ComboBoxEntry.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/ComboBoxEntry.qml index ce88964..c7e91b1 100644 --- a/src/settingsui/network/ComboBoxEntry.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/ComboBoxEntry.qml @@ -42,8 +42,8 @@ RowLayout { property alias model: cb.model property alias count: cb.count property int titleWidth: -1 - signal activated(var index) - signal highlighted(var index) + signal activated(int index) + signal highlighted(int index) Label { id: label diff --git a/src/settingsui/common/CustomSwitch.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CustomSwitch.qml index c552127..34b0421 100644 --- a/src/settingsui/common/CustomSwitch.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CustomSwitch.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -27,8 +27,9 @@ ** ****************************************************************************/ import QtQuick -import QtDeviceUtilities.QtButtonImageProvider import QtQuick.Controls +import DeviceUtilities.SettingsUI +import DeviceUtilities.QtButtonImageProvider Switch { id: control @@ -56,7 +57,7 @@ Switch { font.pixelSize: parent.height * 0.55 color: "#3b4155" text: "OFF" - font.family: appFont + font.family: Globals.appFont } Text { id: onText @@ -70,7 +71,7 @@ Switch { font.pixelSize: parent.height * 0.55 color: "#3b4155" text: "ON" - font.family: appFont + font.family: Globals.appFont } Binding { @@ -90,7 +91,7 @@ Switch { anchors.verticalCenter: parent.verticalCenter width: parent.width * 0.475 height: parent.height * 0.9 - fillColor: control.checked ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor + fillColor: control.checked ? Globals.buttonGreenColor : Globals.buttonGrayColor text: control.checked ? "ON" : "OFF" borderColor: "transparent" Behavior on x { diff --git a/src/settingsui/common/CustomTableView.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CustomTableView.qml index a5a7fe8..059795c 100644 --- a/src/settingsui/common/CustomTableView.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/CustomTableView.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -29,6 +29,7 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls +import DeviceUtilities.SettingsUI ColumnLayout { id: root @@ -64,7 +65,7 @@ ColumnLayout { contentItem: Rectangle { implicitWidth: listView.width * 0.0175 implicitHeight: listView.height * 0.5 - color: viewSettings.scrollBarColor + color: Globals.scrollBarColor } } @@ -91,8 +92,8 @@ ColumnLayout { antialiasing: false smooth: false renderType: listView.moving ? Text.NativeRendering : Text.QtRendering - color: listView.currentIndex == delegateRectangle.index ? viewSettings.buttonGreenColor : "white" - font.family: appFont + color: listView.currentIndex == delegateRectangle.index ? Globals.buttonGreenColor : "white" + font.family: Globals.appFont } } } diff --git a/src/settingsui/network/EditWiredSettings.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/EditWiredSettings.qml index a59da20..a59da20 100644 --- a/src/settingsui/network/EditWiredSettings.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/EditWiredSettings.qml diff --git a/src/settingsui/network/IpAddressTextField.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/IpAddressTextField.qml index 748e402..a328775 100644 --- a/src/settingsui/network/IpAddressTextField.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/IpAddressTextField.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -27,7 +27,6 @@ ** ****************************************************************************/ import QtQuick -import QtQuick.Layouts import QtQuick.Controls TextField { diff --git a/src/settingsui/network/NetworkDetails.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/NetworkDetails.qml index 88b0946..88b0946 100644 --- a/src/settingsui/network/NetworkDetails.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/NetworkDetails.qml diff --git a/src/settingsui/network/NetworkListView.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/NetworkListView.qml index 7c35433..68498b5 100644 --- a/src/settingsui/network/NetworkListView.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/NetworkListView.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -27,10 +27,9 @@ ** ****************************************************************************/ import QtQuick -import QtQml import QtDeviceUtilities.NetworkSettings -import QtDeviceUtilities.QtButtonImageProvider -import QtQuick.Controls +import DeviceUtilities.SettingsUI +import DeviceUtilities.QtButtonImageProvider ListView { id: list @@ -59,9 +58,9 @@ ListView { id: networkName horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - color: connected ? viewSettings.buttonGreenColor : "white" + font.pixelSize: Globals.subTitleFontSize + font.family: Globals.appFont + color: connected ? Globals.buttonGreenColor : "white" text: name } Row { @@ -69,7 +68,7 @@ ListView { height: networkDelegate.height * 0.275 * opacity spacing: networkDelegate.width * 0.0075 Item { - width: pluginMain.margin + width: Globals.margin(list.width) height: 1 } Text { @@ -77,9 +76,9 @@ ListView { height: parent.height anchors.verticalCenter: parent.verticalCenter text: qsTr("IP Address:") - color: connected ? viewSettings.buttonGreenColor : "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont + color: connected ? Globals.buttonGreenColor : "white" + font.pixelSize: Globals.valueFontSize + font.family: Globals.appFont verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } @@ -90,24 +89,25 @@ ListView { anchors.verticalCenter: parent.verticalCenter verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft - color: connected ? viewSettings.buttonGreenColor : "white" + color: connected ? Globals.buttonGreenColor : "white" text: connected ? NetworkSettingsManager.services.itemFromRow(index).ipv4.address : (NetworkSettingsManager.services.itemFromRow(index).state === NetworkSettingsState.Idle) ? qsTr("Not connected") : qsTr("Connecting") - font.pixelSize: pluginMain.valueFontSize - font.family: appFont + font.pixelSize: Globals.valueFontSize + font.family: Globals.appFont font.styleName: connected ? "SemiBold" : "Regular" } } } QtButton { id: connectButton + fontFamily: Globals.appFont anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - fillColor: connected ? viewSettings.buttonGrayColor : viewSettings.buttonGreenColor + fillColor: connected ? Globals.buttonGrayColor : Globals.buttonGreenColor borderColor: "transparent" text: connected ? qsTr("DISCONNECT") : qsTr("CONNECT") - height: pluginMain.buttonHeight + height: Globals.buttonHeight onClicked: { if (connected) { NetworkSettingsManager.services.itemFromRow(index).disconnectService(); @@ -124,7 +124,7 @@ ListView { Rectangle { id: delegateBottom width: networkDelegate.width - color: viewSettings.borderColor + color: Globals.borderColor height: 2 anchors.bottom: networkDelegate.bottom anchors.horizontalCenter: networkDelegate.horizontalCenter diff --git a/src/settingsui/network/NetworkSettings.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/NetworkSettings.qml index a0555f4..2b59c61 100644 --- a/src/settingsui/network/NetworkSettings.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/NetworkSettings.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -27,11 +27,9 @@ ** ****************************************************************************/ import QtQuick -import QtQuick.Layouts -import QtQuick.Controls import QtDeviceUtilities.NetworkSettings -import QtDeviceUtilities.QtButtonImageProvider -import "../common" +import DeviceUtilities.QtButtonImageProvider +import DeviceUtilities.SettingsUI Item { id: networkSettingsRoot @@ -41,22 +39,23 @@ Item { Text { id: wlanText text: qsTr("WLAN") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont + font.pixelSize: networkSettingsRoot.height * Globals.subTitleFontSize + font.family: Globals.appFont font.styleName: "SemiBold" color: "white" anchors.top: networkSettingsRoot.top - anchors.left: parent.left + anchors.left: networkSettingsRoot.left } CustomSwitch { id: wifiSwitch anchors.top: wlanText.bottom anchors.left: wlanText.left - height: pluginMain.buttonHeight - indicatorWidth: pluginMain.buttonWidth - indicatorHeight: pluginMain.buttonHeight + height: networkSettingsRoot.height * Globals.buttonHeight + indicatorWidth: networkSettingsRoot.height * Globals.buttonWidth + indicatorHeight: networkSettingsRoot.height * Globals.buttonHeight property bool wiFiAvailable: NetworkSettingsManager.interface(NetworkSettingsType.Wifi, 0) !== null - enabled: wiFiAvailable && !wifiSwitchTimer.running + checkable: wiFiAvailable && !wifiSwitchTimer.running + onCheckedChanged: { // Power on/off all WiFi interfaces for (var i = 0; NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i) !== null; i++) { @@ -64,17 +63,6 @@ Item { wifiSwitchTimer.start() } } - Component.onCompleted: { - // If any of the WiFi interfaces is powered on, switch is checked - var checkedStatus = false; - for (var i = 0; NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i) !== null; i++) { - if (NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i).powered) { - checkedStatus = true; - break; - } - } - checked = checkedStatus; - } // At least 1s between switching on/off Timer { @@ -90,9 +78,9 @@ Item { anchors.right: manualDisconnect.left anchors.rightMargin: 10 enabled: wifiSwitch.checked - fillColor: enabled ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor + fillColor: enabled ? Globals.buttonGreenColor : Globals.buttonGrayColor borderColor: "transparent" - height: pluginMain.buttonHeight + height: networkSettingsRoot.height * Globals.buttonHeight text: qsTr("MANUAL CONNECT") onClicked: { networkList.connectBySsid() @@ -101,11 +89,11 @@ Item { QtButton { id: manualDisconnect anchors.top: wlanText.bottom - anchors.right: parent.right + anchors.right: networkSettingsRoot.right enabled: NetworkSettingsManager.currentWifiConnection - fillColor: enabled ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor + fillColor: enabled ? Globals.buttonGreenColor : Globals.buttonGrayColor borderColor: "transparent" - height: pluginMain.buttonHeight + height: networkSettingsRoot.height * Globals.buttonHeight text: qsTr("DISCONNECT") onClicked: { if (NetworkSettingsManager.currentWifiConnection) { @@ -116,8 +104,8 @@ Item { Text { id: networkListTextItem text: qsTr("Network list:") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont + font.pixelSize: networkSettingsRoot.height * Globals.subTitleFontSize + font.family: Globals.appFont font.styleName: "SemiBold" color: "white" anchors.top: wifiSwitch.bottom diff --git a/src/settingsui/network/PassphraseEnter.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/PassphraseEnter.qml index 5d3167c..f0978d2 100644 --- a/src/settingsui/network/PassphraseEnter.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/PassphraseEnter.qml @@ -28,22 +28,26 @@ ****************************************************************************/ import QtQuick import QtQuick.Controls -import QtDeviceUtilities.QtButtonImageProvider import QtDeviceUtilities.NetworkSettings +import DeviceUtilities.SettingsUI +import DeviceUtilities.QtButtonImageProvider Rectangle { id: passphrasePopup - width: root.width - height: root.height - color: viewSettings.backgroundColor + width: parent.width + height: parent.height + color: Globals.backgroundColor opacity: 0.9 property string extraInfo: "" property bool showSsid: false + property int margin: (width / 3 * 2) * 0.05 + property int spacing: margin * 0.5 + Rectangle { id: frame - color: viewSettings.backgroundColor - border.color: viewSettings.borderColor + color: Globals.backgroundColor + border.color: Globals.borderColor border.width: 3 anchors.centerIn: parent width: passphraseColumn.width * 1.1 @@ -52,12 +56,12 @@ Rectangle { Column { id: passphraseColumn anchors.centerIn: parent - spacing: viewSettings.spacing + spacing: spacing Text { visible: showSsid - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont + font.pixelSize: parent.height * Globals.subTitleFontSize + font.family: Globals.appFont color: "white" text: qsTr("Enter SSID") } @@ -65,26 +69,26 @@ Rectangle { TextField { id: ssidField visible: showSsid - width: root.width * 0.4 - height: root.height * 0.075 + width: passphrasePopup.width * 0.4 + height: passphrasePopup.height * 0.075 color: "white" background: Rectangle{ color: "transparent" - border.color: ssidField.focus ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor + border.color: ssidField.focus ? Globals.buttonGreenColor : Globals.buttonGrayColor border.width: ssidField.focus ? width * 0.01 : 2 } } Text { - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont + font.pixelSize: parent.height * Globals.subTitleFontSize + font.family: Globals.appFont color: "white" text: qsTr("Enter Passphrase") } Text { - font.pixelSize: pluginMain.valueFontSize - font.family: appFont + font.pixelSize: parent.height * Globals.valueFontSize + font.family: Globals.appFont color: "red" text: extraInfo visible: (extraInfo !== "") @@ -92,13 +96,13 @@ Rectangle { TextField { id: passField - width: root.width * 0.4 - height: root.height * 0.075 + width: passphrasePopup.width * 0.4 + height: passphrasePopup.height * 0.075 color: "white" echoMode: TextInput.Password background: Rectangle{ color: "transparent" - border.color: passField.focus ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor + border.color: passField.focus ? Globals.buttonGreenColor : Globals.buttonGrayColor border.width: passField.focus ? width * 0.01 : 2 } } @@ -122,7 +126,7 @@ Rectangle { id: cancelButton text: qsTr("CANCEL") borderColor: "transparent" - fillColor: viewSettings.buttonGrayColor + fillColor: Globals.buttonGrayColor onClicked: { if (!showSsid) { NetworkSettingsManager.userAgent.cancelInput() diff --git a/src/settingsui/network/WifiSelectorDelegate.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WifiSelectorDelegate.qml index 3c462c5..9c2ad11 100644 --- a/src/settingsui/network/WifiSelectorDelegate.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WifiSelectorDelegate.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -29,7 +29,6 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls -import QtDeviceUtilities.NetworkSettings ItemDelegate { id: root diff --git a/src/settingsui/network/WifiSettings.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WifiSettings.qml index 0286483..7b4f246 100644 --- a/src/settingsui/network/WifiSettings.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WifiSettings.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -36,6 +36,7 @@ Item { anchors.fill: parent Component.onCompleted: NetworkSettingsManager.services.type = NetworkSettingsType.Wifi; property bool connecting: false + property var selectedInterface: undefined Flickable { anchors.fill: parent @@ -89,7 +90,7 @@ Item { textRole: "name" Layout.fillWidth: true - onActivated: { + onActivated: function(index) { if (index >= 0) { connectView.visible = false @@ -160,7 +161,7 @@ Item { property alias text: text.text Image { - source: "../icons/Alert_yellow_1x.png" + source: "icons/Alert_yellow_1x.png" Layout.alignment: Qt.AlignVCenter } Text { diff --git a/src/settingsui/network/WifiSignalMonitor.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WifiSignalMonitor.qml index 25e4aa4..bfbcb1d 100644 --- a/src/settingsui/network/WifiSignalMonitor.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WifiSignalMonitor.qml @@ -58,7 +58,7 @@ Item { id: sprite property int currentFrame: 0 anchors.fill: parent - source: "../icons/Wifi_lightgray_2x.png" + source: "icons/Wifi_lightgray_2x.png" clip: true Timer { @@ -77,7 +77,7 @@ Item { Image { height: parent.height width: parent.width * 4 - source: "../icons/WifiAnim_black_2x.png" + source: "icons/WifiAnim_black_2x.png" x: -parent.currentFrame * width / 4 } } diff --git a/src/settingsui/network/WiredSettings.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WiredSettings.qml index f5d3a8f..f5d3a8f 100644 --- a/src/settingsui/network/WiredSettings.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/WiredSettings.qml diff --git a/src/settingsui/settingsuiplugin/icons/Alert_yellow_1x.png b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/Alert_yellow_1x.png Binary files differindex 6fd25cb..6fd25cb 100644 --- a/src/settingsui/settingsuiplugin/icons/Alert_yellow_1x.png +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/Alert_yellow_1x.png diff --git a/src/settingsui/settingsuiplugin/icons/WifiAnim_black_2x.png b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/WifiAnim_black_2x.png Binary files differindex c2dc8c5..c2dc8c5 100644 --- a/src/settingsui/settingsuiplugin/icons/WifiAnim_black_2x.png +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/WifiAnim_black_2x.png diff --git a/src/settingsui/settingsuiplugin/icons/Wifi_lightgray_2x.png b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/Wifi_lightgray_2x.png Binary files differindex b71b22e..b71b22e 100644 --- a/src/settingsui/settingsuiplugin/icons/Wifi_lightgray_2x.png +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/Wifi_lightgray_2x.png diff --git a/src/settingsui/settingsuiplugin/icons/generate_icons.sh b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/generate_icons.sh index 7218df0..7218df0 100755 --- a/src/settingsui/settingsuiplugin/icons/generate_icons.sh +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/generate_icons.sh diff --git a/src/settingsui/settingsuiplugin/icons/ref/extra/Alert.png b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/ref/extra/Alert.png Binary files differindex 80914fc..80914fc 100644 --- a/src/settingsui/settingsuiplugin/icons/ref/extra/Alert.png +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/ref/extra/Alert.png diff --git a/src/settingsui/settingsuiplugin/icons/scripts/cimage.sh b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/cimage.sh index adbbb7f..adbbb7f 100755 --- a/src/settingsui/settingsuiplugin/icons/scripts/cimage.sh +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/cimage.sh diff --git a/src/settingsui/settingsuiplugin/icons/scripts/cimages.sh b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/cimages.sh index db1ad04..db1ad04 100755 --- a/src/settingsui/settingsuiplugin/icons/scripts/cimages.sh +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/cimages.sh diff --git a/src/settingsui/settingsuiplugin/icons/scripts/rimage.sh b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/rimage.sh index 69b65a3..69b65a3 100755 --- a/src/settingsui/settingsuiplugin/icons/scripts/rimage.sh +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/rimage.sh diff --git a/src/settingsui/settingsuiplugin/icons/scripts/rimages.sh b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/rimages.sh index e9e01b0..e9e01b0 100755 --- a/src/settingsui/settingsuiplugin/icons/scripts/rimages.sh +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/Network/icons/scripts/rimages.sh diff --git a/src/settingsui/settingsuiplugin/SettingsDelegate.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsDelegate.qml index cf7696a..b3a1193 100644 --- a/src/settingsui/settingsuiplugin/SettingsDelegate.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsDelegate.qml @@ -27,11 +27,14 @@ ** ****************************************************************************/ import QtQuick +import DeviceUtilities.SettingsUI Item { - width: settingsList.width - height: settingsList.height * 0.08 + id: delegate + width: parent.width + height: parent.height * 0.08 + //TODO: Do not expect id from other qml file to work/exist property bool isSelected: settingsList.currentIndex == index Image { @@ -57,13 +60,14 @@ Item { fontSizeMode: Text.Fit minimumPixelSize: 1 font.pixelSize: Math.min(parent.width * 0.25, parent.height) - color: parent.isSelected ? viewSettings.buttonGreenColor : "white" + color: delegate.isSelected ? Globals.buttonGreenColor : "white" wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter - font.family: appFont - font.styleName: parent.isSelected ? "Bold" : "Regular" + font.family: Globals.appFont + font.styleName: delegate.isSelected ? "Bold" : "Regular" } + //TODO: Do not expect id from other qml file to work/exist MouseArea { id: mouseArea anchors.fill: parent diff --git a/src/settingsui/settingsuiplugin/SettingsHeader.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsHeader.qml index 1d2f737..5667a3c 100644 --- a/src/settingsui/settingsuiplugin/SettingsHeader.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsHeader.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -34,54 +34,57 @@ Item { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.margins: pluginMain.margin - height: pluginMain.margin * 4 + anchors.margins: margin + height: margin * 4 + + property int margin: Globals.margin(header.width) + property int spacing: margin * 0.5 signal clicked() Image { - id: backButton - objectName: "settingsBackButton" - anchors.left: parent.left - anchors.top: parent.top - source: "../newIcons/back_icon.svg" - height: parent.height * 0.5 + id: networkButton + anchors.left: header.left + anchors.top: header.top + source: "icons/back.svg" + height: header.height * 0.5 width: height / sourceSize.height * sourceSize.width MouseArea { anchors.fill: parent anchors.margins: -parent.height * 0.2 - onClicked: header.clicked() + onClicked: parent.clicked() } + visible: false } Text { id: settingsText - anchors.left: backButton.right - anchors.verticalCenter: backButton.verticalCenter - font.pixelSize: parent.height * 0.45 + anchors.left: networkButton.right + anchors.verticalCenter: networkButton.verticalCenter + font.pixelSize: header.height * 0.45 text: qsTr("Settings") color: "white" - font.family: appFont + font.family: Globals.appFont font.styleName: "SemiBold" MouseArea { anchors.fill: parent anchors.margins: -parent.height * 0.2 - onClicked: header.clicked() + onClicked: parent.clicked() } } Text { id: ipItem - width: parent.width * 0.25 - height: parent.height/2 + width: header.width * 0.25 + height: header.height/2 anchors.top: settingsText.top - anchors.right: parent.right - anchors.rightMargin: pluginMain.margin + anchors.right: header.right + anchors.rightMargin: margin horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter - font.pixelSize: parent.height * 0.3 + font.pixelSize: header.height * 0.3 color: "white" - font.family: appFont + font.family: Globals.appFont font.styleName: "SemiBold" text: NetworkSettingsManager.currentWiredConnection ? qsTr("Wired IP: ") + @@ -90,16 +93,16 @@ Item { Text { id: wifiIpItem - width: parent.width * 0.25 - height: parent.height/2 + width: header.width * 0.25 + height: header.height/2 anchors.top: ipItem.bottom anchors.right: parent.right - anchors.rightMargin: pluginMain.margin + anchors.rightMargin: margin horizontalAlignment: Text.AlignRight verticalAlignment: Text.AlignVCenter - font.pixelSize: parent.height * 0.3 + font.pixelSize: header.height * 0.3 color: "white" - font.family: appFont + font.family: Globals.appFont font.styleName: "SemiBold" text: NetworkSettingsManager.currentWifiConnection ? qsTr("Wireless IP: ") + diff --git a/src/settingsui/settingsuiplugin/SettingsTitleItem.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsTitleItem.qml index 6156091..d43f8e8 100644 --- a/src/settingsui/settingsuiplugin/SettingsTitleItem.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsTitleItem.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -30,17 +30,17 @@ import QtQuick Column { id: page - spacing: pluginMain.spacing + spacing: Globals.margin(page.width) * Globals.spacing property alias title: displayText.text Text { id: displayText - font.pixelSize: pluginMain.titleFontSize + font.pixelSize: (page.parent.height * Globals.titleFontSize) color: "white" fontSizeMode: Text.Fit minimumPixelSize: 1 - font.family: appFont + font.family: Globals.appFont font.styleName: "Bold" } @@ -51,7 +51,7 @@ Column { } Item { - height: pluginMain.margin + height: Globals.margin(page.width) width: 1 } } diff --git a/src/settingsui/settingsuiplugin/pluginMain.qml b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsUI.qml index 76a6ced..44ce51d 100644 --- a/src/settingsui/settingsuiplugin/pluginMain.qml +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/SettingsUI.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -27,27 +27,15 @@ ** ****************************************************************************/ import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.settings -import QtDeviceUtilities.NetworkSettings +import DeviceUtilities.SettingsUI.Network Rectangle { - id: pluginMain + id: main anchors.fill: parent - visible: true - color: "#09102b" + color: Globals.backgroundColor opacity: 0.97 - property var service - property int margin: (pluginMain.width / 3 * 2) * 0.05 - property int spacing: margin * 0.5 - property int titleFontSize: height * 0.04 - property int subTitleFontSize: height * 0.035 - property int valueFontSize: height * 0.025 - property int fieldHeight: height * 0.07 - property int fieldTextHeight: height * 0.05 - property int buttonHeight: height * 0.05 + property int margin: Globals.margin(main.width) signal closed() @@ -60,7 +48,7 @@ Rectangle { SettingsHeader { id: settingsHeader - onClicked: pluginMain.closed() + onClicked: main.closed() } ListModel { @@ -69,8 +57,8 @@ Rectangle { ListElement { title: "Network" view: "NetworkSettings" - path: "network" - icon: "newIcons/network_icon.svg" + path: "Network" + icon: "icons/network.svg" } } @@ -78,9 +66,9 @@ Rectangle { id: settingsList objectName: "settingsList" anchors.top: settingsHeader.bottom - anchors.left: parent.left - anchors.bottom: parent.bottom - width: parent.width / 3.33 + anchors.left: main.left + anchors.bottom: main.bottom + width: main.width / 3.33 model: settingsListModel delegate: SettingsDelegate {} @@ -89,18 +77,20 @@ Rectangle { SettingsTitleItem { id: titleItem anchors.left: settingsList.right - anchors.right: parent.right + anchors.right: main.right anchors.top: settingsHeader.bottom - anchors.leftMargin: pluginMain.margin * 2 + anchors.leftMargin: margin * 2 } Loader { id: settingsLoader + width: main.width + height: main.height anchors.top: titleItem.bottom anchors.left: settingsList.right - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.leftMargin: pluginMain.margin * 2 - anchors.rightMargin: pluginMain.margin * 2 + anchors.right: main.right + anchors.bottom: main.bottom + anchors.leftMargin: margin * 2 + anchors.rightMargin: margin * 2 } } diff --git a/src/settingsui/settingsuiplugin/newIcons/back_icon.svg b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/icons/back.svg index 6034bd7..6034bd7 100644 --- a/src/settingsui/settingsuiplugin/newIcons/back_icon.svg +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/icons/back.svg diff --git a/src/settingsui/settingsuiplugin/newIcons/network_icon.svg b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/icons/network.svg index 157fb52..157fb52 100644 --- a/src/settingsui/settingsuiplugin/newIcons/network_icon.svg +++ b/examples/deviceutilities/settingsuiapp/DeviceUtilities/SettingsUI/icons/network.svg diff --git a/src/settingsui/common/HandwritingModeButton.qml b/examples/deviceutilities/settingsuiapp/HandwritingModeButton.qml index 8b47d2e..adbb262 100644 --- a/src/settingsui/common/HandwritingModeButton.qml +++ b/examples/deviceutilities/settingsuiapp/HandwritingModeButton.qml @@ -48,7 +48,7 @@ Item { sourceSize.width: handwritingModeButton.__minWidthHeight sourceSize.height: handwritingModeButton.__minWidthHeight smooth: false - source: "qrc:/icons/FloatingButton_Unavailable.png" + source: "images/FloatingButton_Unavailable.png" } back: Image { @@ -56,7 +56,7 @@ Item { sourceSize.width: handwritingModeButton.__minWidthHeight sourceSize.height: handwritingModeButton.__minWidthHeight smooth: false - source: "qrc:/icons/FloatingButton_Available.png" + source: "images/FloatingButton_Available.png" } states: State { @@ -86,7 +86,7 @@ Item { State { name: "active" PropertyChanges { target: flipableImage; flipped: true } - PropertyChanges { target: buttonImage; source: "qrc:/icons/FloatingButton_Active.png" } + PropertyChanges { target: buttonImage; source: "images/FloatingButton_Active.png" } } ] diff --git a/examples/deviceutilities/settingsuiapp/applicationsettings.cpp b/examples/deviceutilities/settingsuiapp/applicationsettings.cpp new file mode 100644 index 0000000..937a0ce --- /dev/null +++ b/examples/deviceutilities/settingsuiapp/applicationsettings.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Device Creation. +** +** $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 "applicationsettings.h" +#include <QGuiApplication> +#include <QScreen> + +ApplicationSettings::ApplicationSettings(QObject *parent) + : QObject(parent) +{ + m_screen = qobject_cast<QGuiApplication *>(QCoreApplication::instance())->primaryScreen(); + + if (m_screen->orientation() == Qt::PortraitOrientation) { + m_width = m_screen->availableGeometry().height(); + m_height = m_screen->availableGeometry().width(); + } else { + m_width = m_screen->availableGeometry().width(); + m_height = m_screen->availableGeometry().height(); + } +} + +bool ApplicationSettings::isHighDpi() +{ + return (m_screen->devicePixelRatio() >= 2.0); +} + +int ApplicationSettings::width() +{ + return m_width; +} + +int ApplicationSettings::height() +{ + return m_height; +} + diff --git a/src/settingsui/ViewSettings.qml b/examples/deviceutilities/settingsuiapp/applicationsettings.h index 4f326cf..7b450e1 100644 --- a/src/settingsui/ViewSettings.qml +++ b/examples/deviceutilities/settingsuiapp/applicationsettings.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Device Creation. @@ -26,18 +26,39 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick - -Item { - id: viewSettings - - property real pageMargin: 0.03 * Math.min(window.width, window.height) - property real spacing: pageMargin * 0.5 - property string appFont: "TitilliumWeb" - property string backgroundColor: "#09102b" - property string borderColor: "#9d9faa" - property string buttonGreenColor: "#41cd52" - property string buttonGrayColor: "#9d9faa" - property string buttonActiveColor: "#216729" - property string scrollBarColor: "#41cd52" -} + +#ifndef APPLICATIONSETTINGS_H +#define APPLICATIONSETTINGS_H + +#include <QObject> +#include <QQmlEngine> + +QT_FORWARD_DECLARE_CLASS(QScreen) + +class ApplicationSettings : public QObject +{ + Q_OBJECT + Q_PROPERTY(int width READ width CONSTANT FINAL) + Q_PROPERTY(int height READ height CONSTANT FINAL) + Q_PROPERTY(bool isHighDpi READ isHighDpi NOTIFY isHighDpiChanged FINAL) + + QML_ELEMENT + QML_SINGLETON + +public: + explicit ApplicationSettings(QObject *parent = nullptr); + + int width(); + int height(); + bool isHighDpi(); + +signals: + void isHighDpiChanged(bool isHighDpi); + +private: + QScreen *m_screen = nullptr; + int m_width = 1280; + int m_height = 720; +}; + +#endif // APPLICATIONSETTINGS_H diff --git a/src/settingsui/settingsuiplugin/icons/FloatingButton_Active.png b/examples/deviceutilities/settingsuiapp/images/FloatingButton_Active.png Binary files differindex 9b55146..9b55146 100755 --- a/src/settingsui/settingsuiplugin/icons/FloatingButton_Active.png +++ b/examples/deviceutilities/settingsuiapp/images/FloatingButton_Active.png diff --git a/src/settingsui/settingsuiplugin/icons/FloatingButton_Available.png b/examples/deviceutilities/settingsuiapp/images/FloatingButton_Available.png Binary files differindex 1479881..1479881 100755 --- a/src/settingsui/settingsuiplugin/icons/FloatingButton_Available.png +++ b/examples/deviceutilities/settingsuiapp/images/FloatingButton_Available.png diff --git a/src/settingsui/settingsuiplugin/icons/FloatingButton_Unavailable.png b/examples/deviceutilities/settingsuiapp/images/FloatingButton_Unavailable.png Binary files differindex 33aa87d..33aa87d 100755 --- a/src/settingsui/settingsuiplugin/icons/FloatingButton_Unavailable.png +++ b/examples/deviceutilities/settingsuiapp/images/FloatingButton_Unavailable.png diff --git a/src/settingsui/main.cpp b/examples/deviceutilities/settingsuiapp/main.cpp index 8ebe695..f2e51aa 100644 --- a/src/settingsui/main.cpp +++ b/examples/deviceutilities/settingsuiapp/main.cpp @@ -29,6 +29,8 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> +#include "applicationsettings.h" + int main(int argc, char *argv[]) { qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); @@ -36,7 +38,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + engine.load(QUrl(QStringLiteral("qrc:///DeviceUtilities/main.qml"))); return app.exec(); } diff --git a/src/settingsui/main.qml b/examples/deviceutilities/settingsuiapp/main.qml index c014923..0c755df 100644 --- a/src/settingsui/main.qml +++ b/examples/deviceutilities/settingsuiapp/main.qml @@ -28,23 +28,20 @@ ****************************************************************************/ import QtQuick import QtQuick.Window -import QtDeviceUtilities.SettingsUI import QtQuick.VirtualKeyboard -import "common" +import DeviceUtilities +import DeviceUtilities.SettingsUI Window { id: window visible: true - - property alias appFont: viewSettings.appFont - - ViewSettings { - id: viewSettings - } + width: ApplicationSettings.width + height: ApplicationSettings.height Item { id: root - anchors.fill: parent + width: window.width + height: window.height SettingsUI { id: settingsUI diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9467fcf..88e2c48 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,5 @@ add_subdirectory(networksettings) -add_subdirectory(networksettingsqml) -add_subdirectory(settingsui/settingsuiplugin) -add_subdirectory(settingsui/qtbuttonimageproviderplugin) -add_subdirectory(settingsui) -add_subdirectory(doc) + +if(TARGET Qt::Qml) + add_subdirectory(networksettingsqml) +endif() diff --git a/src/doc/src/qtdeviceutilities-index.qdoc b/src/doc/src/qtdeviceutilities-index.qdoc index aea43b5..c7e0d96 100644 --- a/src/doc/src/qtdeviceutilities-index.qdoc +++ b/src/doc/src/qtdeviceutilities-index.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -62,7 +62,6 @@ \code import QtDeviceUtilities.NetworkSettings - import QtDeviceUtilities.SettingsUI \endcode \section1 Examples diff --git a/src/doc/src/qtdeviceutilities-module-qml.qdoc b/src/doc/src/qtdeviceutilities-module-qml.qdoc index 2c8fef5..510fc01 100644 --- a/src/doc/src/qtdeviceutilities-module-qml.qdoc +++ b/src/doc/src/qtdeviceutilities-module-qml.qdoc @@ -35,15 +35,11 @@ \badcode import QtDeviceUtilities.NetworkSettings - import QtDeviceUtilities.SettingsUI \endcode \section1 QML Types \section2 Qt Network Settings Module \generatelist qmltypesbymodule QtDeviceUtilities.NetworkSettings - - \section2 Qt Settings UI Module - \generatelist qmltypesbymodule QtDeviceUtilities.SettingsUI */ diff --git a/src/settingsui/CMakeLists.txt b/src/settingsui/CMakeLists.txt deleted file mode 100644 index 5bec7ee..0000000 --- a/src/settingsui/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -##################################################################### -## settingsui Binary: -##################################################################### - -qt_internal_add_executable(settingsui - GUI - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Qml - Qt::Quick -) - -# Resources: -set(settingsuiapp_resource_files - "AutoScroller.qml" - "ViewSettings.qml" - "common/CustomSwitch.qml" - "common/HandwritingModeButton.qml" - "main.qml" - "network/AddressListEntry.qml" - "network/ComboBoxEntry.qml" - "network/EditWiredSettings.qml" - "network/IpAddressTextField.qml" - "network/NetworkDetails.qml" - "network/NetworkListView.qml" - "network/NetworkSettings.qml" - "network/PassphraseEnter.qml" - "network/WifiSelectorDelegate.qml" - "network/WifiSettings.qml" - "network/WifiSignalMonitor.qml" - "network/WiredSettings.qml" - "settingsuiplugin/SettingsDelegate.qml" - "settingsuiplugin/SettingsHeader.qml" - "settingsuiplugin/SettingsTitleItem.qml" - "settingsuiplugin/pluginMain.qml" -) - -qt_internal_add_resource(settingsui "settingsuiapp" - PREFIX - "/" - FILES - ${settingsuiapp_resource_files} -) - -qt_internal_extend_target(settingsui CONDITION static - PUBLIC_LIBRARIES - Qt::Svg -) diff --git a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt b/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt deleted file mode 100644 index d799013..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -##################################################################### -## qtbuttonimageproviderplugin Plugin: -##################################################################### - -qt_internal_add_qml_module(qtbuttonimageproviderplugin - URI "QtDeviceUtilities.QtButtonImageProvider" - VERSION "${CMAKE_PROJECT_VERSION}" - CLASS_NAME QtButtonImageProviderQmlPlugin - PLUGIN_TARGET qtbuttonimageproviderplugin - NO_PLUGIN_OPTIONAL - NO_GENERATE_PLUGIN_SOURCE - CLASS_NAME QtButtonImageProviderPlugin - PAST_MAJOR_VERSIONS 1 - DEPENDENCIES - QtQml - SOURCES - plugin.cpp plugin_p.h - qtbuttonimageprovider.cpp qtbuttonimageprovider.h - LIBRARIES - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick - QML_FILES - "QtButton.qml" -) diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h b/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h deleted file mode 100644 index 9fa479d..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/plugin_p.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** 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 <qqmlextensionplugin.h> -#include <qqmlengine.h> - -#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/settingsuiapp.qrc b/src/settingsui/settingsuiapp.qrc deleted file mode 100644 index 844ba29..0000000 --- a/src/settingsui/settingsuiapp.qrc +++ /dev/null @@ -1,25 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>common/HandwritingModeButton.qml</file> - <file>AutoScroller.qml</file> - <file>common/CustomSwitch.qml</file> - <file>network/PassphraseEnter.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/NetworkListView.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>settingsuiplugin/pluginMain.qml</file> - <file>settingsuiplugin/SettingsDelegate.qml</file> - <file>settingsuiplugin/SettingsHeader.qml</file> - <file>settingsuiplugin/SettingsTitleItem.qml</file> - <file>ViewSettings.qml</file> - </qresource> -</RCC> diff --git a/src/settingsui/settingsuiplugin/CMakeLists.txt b/src/settingsui/settingsuiplugin/CMakeLists.txt deleted file mode 100644 index 6ab5bf7..0000000 --- a/src/settingsui/settingsuiplugin/CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ -##################################################################### -## settingsuiplugin Plugin: -##################################################################### -set(settingsui_qml_files - "../common/CustomSwitch.qml" - "../common/CustomTableView.qml" - "../common/HandwritingModeButton.qml" - "../network/AddressListEntry.qml" - "../network/ComboBoxEntry.qml" - "../network/EditWiredSettings.qml" - "../network/IpAddressTextField.qml" - "../network/NetworkDetails.qml" - "../network/NetworkListView.qml" - "../network/NetworkSettings.qml" - "../network/PassphraseEnter.qml" - "../network/WifiSelectorDelegate.qml" - "../network/WifiSettings.qml" - "../network/WifiSignalMonitor.qml" - "../network/WiredSettings.qml" - "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" - "icons/FloatingButton_Unavailable.png" - "icons/WifiAnim_black_2x.png" - "icons/Wifi_lightgray_2x.png" - "newIcons/back_icon.svg" - "newIcons/network_icon.svg" -) - -qt_internal_add_resource(settingsuiplugin "settingsui" - PREFIX - "/" - FILES - ${settingsui_resource_files} -) diff --git a/src/settingsui/settingsuiplugin/plugin.cpp b/src/settingsui/settingsuiplugin/plugin.cpp deleted file mode 100644 index 8ac64e1..0000000 --- a/src/settingsui/settingsuiplugin/plugin.cpp +++ /dev/null @@ -1,72 +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_p.h" -/*! - \qmlmodule QtDeviceUtilities.SettingsUI - \title Qt Device Utilities: Settings UI - \ingroup qtdevice-utilities-qml-modules - \ingroup 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. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.SettingsUI - \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 - import QtDeviceUtilities.SettingsUI - - 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. -*/ |