diff options
author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-05-12 12:23:19 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-05-15 10:27:55 +0000 |
commit | a57405a64b5a64104610080218d4311197df0cd1 (patch) | |
tree | aecfbdae6182d9fbeaa6b8c3c023f67ad2fad892 | |
parent | 683c8ed5da398a66a8d193519430b19f64366bfc (diff) |
LowEnergyScanner: QML Revamp
- Modifications as per ca681cd1b3a51d10106a1287a98c5590100feb6a
Task-number: PYSIDE-2206
Change-Id: Iffcfa58245652fde180f43c560085ae7855ac221
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit fbcf425088f623d440e4a8b342d7fbab9bf5e6b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
15 files changed, 272 insertions, 1029 deletions
diff --git a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml b/examples/bluetooth/lowenergyscanner/Scanner/Characteristics.qml index 085346d5f..bd3ccbfcb 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml +++ b/examples/bluetooth/lowenergyscanner/Scanner/Characteristics.qml @@ -2,9 +2,15 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +pragma ComponentBehavior: Bound import QtQuick Rectangle { + id: characteristicsPage + + signal showServices + signal showDevices + width: 300 height: 600 @@ -18,12 +24,12 @@ Rectangle { id: info anchors.centerIn: parent visible: true - dialogText: "Scanning for characteristics..."; + dialogText: "Scanning for characteristics..." } Connections { - target: device - function oncharacteristic_updated() { + target: Device + function oncharacteristics_pdated() { menu.menuText = "Back" if (characteristicview.count === 0) { info.dialogText = "No characteristic found" @@ -35,7 +41,7 @@ Rectangle { } function onDisconnected() { - pageLoader.source = "qrc:/assets/main.qml" + characteristicsPage.showDevices() } } @@ -46,11 +52,12 @@ Rectangle { anchors.top: header.bottom anchors.bottom: menu.top - model: device.characteristic_list + model: Device.characteristicList delegate: Rectangle { - id: characteristicbox - height:300 + required property var modelData + id: box + height: 300 width: characteristicview.width color: "lightsteelblue" border.width: 2 @@ -58,24 +65,24 @@ Rectangle { radius: 5 Label { - id: characteristic_name - textContent: modelData.characteristic_name + id: characteristicName + textContent: box.modelData.characteristic_name anchors.top: parent.top anchors.topMargin: 5 } Label { - id: characteristic_uuid - font.pointSize: characteristic_name.font.pointSize*0.7 - textContent: modelData.characteristic_uuid - anchors.top: characteristic_name.bottom + id: characteristicUuid + font.pointSize: characteristicName.font.pointSize * 0.7 + textContent: box.modelData.characteristic_uuid + anchors.top: characteristicName.bottom anchors.topMargin: 5 } Label { - id: characteristic_value - font.pointSize: characteristic_name.font.pointSize*0.7 - textContent: ("Value: " + modelData.characteristic_value) + id: characteristicValue + font.pointSize: characteristicName.font.pointSize * 0.7 + textContent: ("Value: " + box.modelData.characteristic_value) anchors.bottom: characteristicHandle.top horizontalAlignment: Text.AlignHCenter anchors.topMargin: 5 @@ -83,16 +90,16 @@ Rectangle { Label { id: characteristicHandle - font.pointSize: characteristic_name.font.pointSize*0.7 - textContent: ("Handlers: " + modelData.characteristicHandle) - anchors.bottom: characteristic_permission.top + font.pointSize: characteristicName.font.pointSize * 0.7 + textContent: ("Handlers: " + box.modelData.characteristic_handle) + anchors.bottom: characteristicPermission.top anchors.topMargin: 5 } Label { - id: characteristic_permission - font.pointSize: characteristic_name.font.pointSize*0.7 - textContent: modelData.characteristic_permission + id: characteristicPermission + font.pointSize: characteristicName.font.pointSize * 0.7 + textContent: box.modelData.characteristic_permission anchors.bottom: parent.bottom anchors.topMargin: 5 anchors.bottomMargin: 5 @@ -104,11 +111,11 @@ Rectangle { id: menu anchors.bottom: parent.bottom menuWidth: parent.width - menuText: device.update - menuHeight: (parent.height/6) + menuText: Device.update + menuHeight: (parent.height / 6) onButtonClick: { - pageLoader.source = "qrc:/assets/Services.qml" - device.update = "Back" + characteristicsPage.showServices() + Device.update = "Back" } } } diff --git a/examples/bluetooth/lowenergyscanner/Scanner/Devices.qml b/examples/bluetooth/lowenergyscanner/Scanner/Devices.qml new file mode 100644 index 000000000..6e5e85a52 --- /dev/null +++ b/examples/bluetooth/lowenergyscanner/Scanner/Devices.qml @@ -0,0 +1,121 @@ +// Copyright (C) 2013 BlackBerry Limited. All rights reserved. +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +pragma ComponentBehavior: Bound +import QtQuick + +Rectangle { + id: devicesPage + + property bool deviceState: Device.state + signal showServices + + width: 300 + height: 600 + + onDeviceStateChanged: { + if (!Device.state) + info.visible = false + } + + Header { + id: header + anchors.top: parent.top + headerText: { + if (Device.state) + return "Discovering" + + if (Device.devices_list.length > 0) + return "Select a device" + + return "Start Discovery" + } + } + + Dialog { + id: info + anchors.centerIn: parent + visible: false + } + + ListView { + id: theListView + width: parent.width + clip: true + + anchors.top: header.bottom + anchors.bottom: connectToggle.top + model: Device.devices_list + + delegate: Rectangle { + required property var modelData + id: box + height: 100 + width: theListView.width + color: "lightsteelblue" + border.width: 2 + border.color: "black" + radius: 5 + + MouseArea { + anchors.fill: parent + onClicked: { + Device.scan_services(box.modelData.device_address) + showServices() + } + } + + Label { + id: deviceName + textContent: box.modelData.device_name + anchors.top: parent.top + anchors.topMargin: 5 + } + + Label { + id: deviceAddress + textContent: box.modelData.device_address + font.pointSize: deviceName.font.pointSize * 0.7 + anchors.bottom: box.bottom + anchors.bottomMargin: 5 + } + } + } + + Menu { + id: connectToggle + + menuWidth: parent.width + anchors.bottom: menu.top + menuText: { + visible = Device.devices_list.length > 0 + if (Device.use_random_address) + return "Address type: Random" + else + return "Address type: Public" + } + + onButtonClick: Device.use_random_address = !Device.use_random_address + } + + Menu { + id: menu + anchors.bottom: parent.bottom + menuWidth: parent.width + menuHeight: (parent.height / 6) + menuText: Device.update + onButtonClick: { + if (!Device.state) { + Device.start_device_discovery() + // if start_device_discovery() failed Device.state is not set + if (Device.state) { + info.dialogText = "Searching..." + info.visible = true + } + } else { + Device.stop_device_discovery() + } + } + } +} diff --git a/examples/bluetooth/lowenergyscanner/assets/Dialog.qml b/examples/bluetooth/lowenergyscanner/Scanner/Dialog.qml index 99c817e22..75e82642a 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Dialog.qml +++ b/examples/bluetooth/lowenergyscanner/Scanner/Dialog.qml @@ -4,7 +4,8 @@ import QtQuick Rectangle { - width: parent.width/3*2 + id: dialog + width: parent.width / 3 * 2 height: dialogTextId.height + background.height + 20 z: 50 property string dialogText: "" @@ -18,11 +19,11 @@ Rectangle { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top; + anchors.top: parent.top anchors.topMargin: 10 elide: Text.ElideMiddle - text: dialogText + text: dialog.dialogText color: "#363636" wrapMode: Text.Wrap } @@ -30,13 +31,18 @@ Rectangle { Image { id: background - width:20 - height:20 + width: 20 + height: 20 anchors.top: dialogTextId.bottom anchors.horizontalCenter: dialogTextId.horizontalCenter visible: parent.busyImage - source: "qrc:/assets/busy_dark.png" + source: "assets/busy_dark.png" fillMode: Image.PreserveAspectFit - NumberAnimation on rotation { duration: 3000; from:0; to: 360; loops: Animation.Infinite} + NumberAnimation on rotation { + duration: 3000 + from: 0 + to: 360 + loops: Animation.Infinite + } } } diff --git a/examples/bluetooth/lowenergyscanner/assets/Header.qml b/examples/bluetooth/lowenergyscanner/Scanner/Header.qml index 7ce8d3d79..c95385dd3 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Header.qml +++ b/examples/bluetooth/lowenergyscanner/Scanner/Header.qml @@ -4,6 +4,7 @@ import QtQuick Rectangle { + id: header width: parent.width height: 70 border.width: 1 @@ -15,7 +16,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter anchors.fill: parent - text: headerText + text: header.headerText font.bold: true font.pointSize: 20 elide: Text.ElideMiddle diff --git a/examples/bluetooth/lowenergyscanner/assets/Label.qml b/examples/bluetooth/lowenergyscanner/Scanner/Label.qml index e31156740..e31156740 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Label.qml +++ b/examples/bluetooth/lowenergyscanner/Scanner/Label.qml diff --git a/examples/bluetooth/lowenergyscanner/Scanner/Main.qml b/examples/bluetooth/lowenergyscanner/Scanner/Main.qml new file mode 100644 index 000000000..88600bace --- /dev/null +++ b/examples/bluetooth/lowenergyscanner/Scanner/Main.qml @@ -0,0 +1,31 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Layouts + +Window { + id: main + + width: 300 + height: 600 + visible: true + + StackLayout { + id: pagesLayout + anchors.fill: parent + currentIndex: 0 + + Devices { + onShowServices: pagesLayout.currentIndex = 1 + } + Services { + onShowDevices: pagesLayout.currentIndex = 0 + onShowCharacteristics: pagesLayout.currentIndex = 2 + } + Characteristics { + onShowDevices: pagesLayout.currentIndex = 0 + onShowServices: pagesLayout.currentIndex = 1 + } + } +} diff --git a/examples/bluetooth/lowenergyscanner/assets/Menu.qml b/examples/bluetooth/lowenergyscanner/Scanner/Menu.qml index f32c7820c..ef69c895e 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Menu.qml +++ b/examples/bluetooth/lowenergyscanner/Scanner/Menu.qml @@ -5,11 +5,12 @@ import QtQuick Rectangle { + id: menu property real menuWidth: 100 property real menuHeight: 50 property string menuText: "Search" - signal buttonClick() + signal buttonClick height: menuHeight width: menuWidth @@ -28,7 +29,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter anchors.fill: parent - text: menuText + text: menu.menuText elide: Text.ElideMiddle color: "#E3E3E3" wrapMode: Text.WordWrap @@ -47,7 +48,7 @@ Rectangle { } onClicked: { - buttonClick() + menu.buttonClick() } } } diff --git a/examples/bluetooth/lowenergyscanner/assets/Services.qml b/examples/bluetooth/lowenergyscanner/Scanner/Services.qml index 3f1bd6b96..70326242e 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Services.qml +++ b/examples/bluetooth/lowenergyscanner/Scanner/Services.qml @@ -2,9 +2,15 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +pragma ComponentBehavior: Bound import QtQuick Rectangle { + id: servicesPage + + signal showCharacteristics + signal showDevices + width: 300 height: 600 @@ -12,9 +18,9 @@ Rectangle { // Loading this page may take longer than QLEController // stopping with an error, go back and readjust this view // based on controller errors - if (device.controller_error) { - info.visible = false; - menu.menuText = device.update + if (Device.controller_error) { + info.visible = false + menu.menuText = Device.update } } @@ -28,20 +34,20 @@ Rectangle { id: info anchors.centerIn: parent visible: true - dialogText: "Scanning for services..."; + dialogText: "Scanning for services..." } Connections { - target: device + target: Device function onservices_updated() { if (servicesview.count === 0) info.dialogText = "No services found" else - info.visible = false; + info.visible = false } - function onDisconnected() { - pageLoader.source = "qrc:/assets/main.qml" + function ondisconnected() { + servicesPage.showDevices() } } @@ -50,47 +56,45 @@ Rectangle { width: parent.width anchors.top: header.bottom anchors.bottom: menu.top - model: device.services_list + model: Device.servicesList clip: true delegate: Rectangle { - id: servicebox - height:100 + required property var modelData + id: box + height: 100 color: "lightsteelblue" border.width: 2 border.color: "black" radius: 5 width: servicesview.width - Component.onCompleted: { - info.visible = false - } MouseArea { anchors.fill: parent onClicked: { - pageLoader.source = "qrc:/assets/Characteristics.qml"; - device.connect_to_service(modelData.service_uuid); + Device.connectToService(box.modelData.service_uuid) + servicesPage.showCharacteristics() } } Label { - id: service_name - textContent: modelData.service_name + id: serviceName + textContent: box.modelData.service_name anchors.top: parent.top anchors.topMargin: 5 } Label { - textContent: modelData.service_type - font.pointSize: service_name.font.pointSize * 0.5 - anchors.top: service_name.bottom + textContent: box.modelData.service_type + font.pointSize: serviceName.font.pointSize * 0.5 + anchors.top: serviceName.bottom } Label { - id: service_uuid - font.pointSize: service_name.font.pointSize * 0.5 - textContent: modelData.service_uuid - anchors.bottom: servicebox.bottom + id: serviceUuid + font.pointSize: serviceName.font.pointSize * 0.5 + textContent: box.modelData.service_uuid + anchors.bottom: box.bottom anchors.bottomMargin: 5 } } @@ -100,12 +104,12 @@ Rectangle { id: menu anchors.bottom: parent.bottom menuWidth: parent.width - menuText: device.update - menuHeight: (parent.height/6) + menuText: Device.update + menuHeight: (parent.height / 6) onButtonClick: { - device.disconnect_from_device() - pageLoader.source = "qrc:/assets/main.qml" - device.update = "Search" + Device.disconnect_from_device() + servicesPage.showDevices() + Device.update = "Search" } } } diff --git a/examples/bluetooth/lowenergyscanner/assets/busy_dark.png b/examples/bluetooth/lowenergyscanner/Scanner/assets/busy_dark.png Binary files differindex 3a1059531..3a1059531 100644 --- a/examples/bluetooth/lowenergyscanner/assets/busy_dark.png +++ b/examples/bluetooth/lowenergyscanner/Scanner/assets/busy_dark.png diff --git a/examples/bluetooth/lowenergyscanner/Scanner/qmldir b/examples/bluetooth/lowenergyscanner/Scanner/qmldir new file mode 100644 index 000000000..0adf6fb19 --- /dev/null +++ b/examples/bluetooth/lowenergyscanner/Scanner/qmldir @@ -0,0 +1,10 @@ +module Scanner +typeinfo scanner.qmltypes +Characteristics 1.0 Characteristics.qml +Devices 1.0 Devices.qml +Dialog 1.0 Dialog.qml +Header 1.0 Header.qml +Label 1.0 Label.qml +Main 1.0 Main.qml +Menu 1.0 Menu.qml +Services 1.0 Services.qml diff --git a/examples/bluetooth/lowenergyscanner/assets/main.qml b/examples/bluetooth/lowenergyscanner/assets/main.qml deleted file mode 100644 index 01bf63cd8..000000000 --- a/examples/bluetooth/lowenergyscanner/assets/main.qml +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (C) 2013 BlackBerry Limited. All rights reserved. -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Rectangle { - id: back - width: 300 - height: 600 - property bool deviceState: device.state - onDevicestate_changed: { - if (!device.state) - info.visible = false; - } - - Header { - id: header - anchors.top: parent.top - headerText: "Start Discovery" - } - - Dialog { - id: info - anchors.centerIn: parent - visible: false - } - - ListView { - id: theListView - width: parent.width - clip: true - - anchors.top: header.bottom - anchors.bottom: connectToggle.top - model: device.devices_list - - delegate: Rectangle { - id: box - height:100 - width: theListView.width - color: "lightsteelblue" - border.width: 2 - border.color: "black" - radius: 5 - - Component.onCompleted: { - info.visible = false; - header.headerText = "Select a device"; - } - - MouseArea { - anchors.fill: parent - onClicked: { - device.scan_services(modelData.device_address); - pageLoader.source = "qrc:/assets/Services.qml" - } - } - - Label { - id: device_name - textContent: modelData.device_name - anchors.top: parent.top - anchors.topMargin: 5 - } - - Label { - id: device_address - textContent: modelData.device_address - font.pointSize: device_name.font.pointSize*0.7 - anchors.bottom: box.bottom - anchors.bottomMargin: 5 - } - } - } - - Menu { - id: connectToggle - - menuWidth: parent.width - anchors.bottom: menu.top - menuText: { if (device.devices_list.length) - visible = true - else - visible = false - if (device.use_random_address) - "Address type: Random" - else - "Address type: Public" - } - - onButtonClick: device.use_random_address = !device.use_random_address; - } - - Menu { - id: menu - anchors.bottom: parent.bottom - menuWidth: parent.width - menuHeight: (parent.height/6) - menuText: device.update - onButtonClick: { - device.start_device_discovery(); - // if start_device_discovery() failed device.state is not set - if (device.state) { - info.dialogText = "Searching..."; - info.visible = true; - } - } - } - - Loader { - id: pageLoader - anchors.fill: parent - } -} diff --git a/examples/bluetooth/lowenergyscanner/device.py b/examples/bluetooth/lowenergyscanner/device.py index d4a2300bc..e69a8450e 100644 --- a/examples/bluetooth/lowenergyscanner/device.py +++ b/examples/bluetooth/lowenergyscanner/device.py @@ -4,12 +4,17 @@ import warnings from PySide6.QtBluetooth import (QBluetoothDeviceDiscoveryAgent, QLowEnergyController, QBluetoothDeviceInfo, QBluetoothUuid, QLowEnergyService) from PySide6.QtCore import QObject, Property, Signal, Slot, QTimer, QMetaObject, Qt +from PySide6.QtQml import QmlElement, QmlSingleton from deviceinfo import DeviceInfo from serviceinfo import ServiceInfo from characteristicinfo import CharacteristicInfo +QML_IMPORT_NAME = "Scanner" +QML_IMPORT_MAJOR_VERSION = 1 +@QmlElement +@QmlSingleton class Device(QObject): devices_updated = Signal() @@ -108,7 +113,7 @@ class Device(QObject): self.update = "Back\n(Connecting to device...)" if self.controller and (self._previousAddress != self.currentDevice.device_address): - self.controller.disconnect_from_device() + self.controller.disconnectFromDevice() del self.controller self.controller = None @@ -167,7 +172,7 @@ class Device(QObject): # device scan progress if self.controller.state() != QLowEnergyController.UnconnectedState: - self.controller.disconnect_from_device() + self.controller.disconnectFromDevice() else: self.device_disconnected() @@ -266,3 +271,9 @@ class Device(QObject): self.characteristic_updated.emit() + @Slot() + def stop_device_discovery(self): + if self.discovery_agent.isActive(): + self.discovery_agent.stop() + + diff --git a/examples/bluetooth/lowenergyscanner/main.py b/examples/bluetooth/lowenergyscanner/main.py index 58eb3175b..dfbff97b3 100644 --- a/examples/bluetooth/lowenergyscanner/main.py +++ b/examples/bluetooth/lowenergyscanner/main.py @@ -5,29 +5,23 @@ import sys -import os -from PySide6.QtCore import QUrl +from PySide6.QtCore import QCoreApplication from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView +from PySide6.QtQml import QQmlApplicationEngine from device import Device from pathlib import Path -import rc_resources - if __name__ == '__main__': app = QGuiApplication(sys.argv) - d = Device() - view = QQuickView() - view.rootContext().setContextProperty("device", d) - src_dir = Path(__file__).resolve().parent - view.engine().addImportPath(os.fspath(src_dir)) - view.engine().quit.connect(view.close) - view.setSource(QUrl.fromLocalFile(":/assets/main.qml")) - view.setResizeMode(QQuickView.SizeRootObjectToView) - view.show() - res = app.exec() - del view - sys.exit(res) + engine = QQmlApplicationEngine() + engine.addImportPath(Path(__file__).parent) + engine.loadFromModule("Scanner", "Main") + + if not engine.rootObjects(): + sys.exit(-1) + ex = QCoreApplication.exec() + del engine + sys.exit(ex) diff --git a/examples/bluetooth/lowenergyscanner/rc_resources.py b/examples/bluetooth/lowenergyscanner/rc_resources.py deleted file mode 100644 index f6e1b10fe..000000000 --- a/examples/bluetooth/lowenergyscanner/rc_resources.py +++ /dev/null @@ -1,816 +0,0 @@ -# Resource object code (Python 3) -# Created by: object code -# Created by: The Resource Compiler for Qt version 6.4.0 -# WARNING! All changes made in this file will be lost! - -from PySide6 import QtCore - -qt_resource_data = b"\ -\x00\x00\x04j\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x002\x00\x00\x002\x08\x06\x00\x00\x00\x1e?\x88\xb1\ -\x00\x00\x041IDATx\xda\xe5\x99\xcbn\xd3@\ -\x14\x86s-\x15\x97RJ\xa1\x04\x0a\x0amQ!U\ -Q\xa4\xa8\xb9\xd2\xc8I\xec\x19;qD\x81E\xc5\x8a\ -\xcb\x96E_\x01\xd8\xc2\x1e\xb1B\xac\xd8t\xc9\x1e\x89\ -'\xe0\x09x\x15\x98\xdf\xf1H\xd3\xc9\xf8\x96\xd8i\x0a\ -G\xfa\xa5\xc8v\x9d\xf9\xfc\x9fs\xe6\xc4M\xa5\x12\x8c\ -\xbei~y<\xb0\xff@\xf8\x9c:\x8b\xa1k\xbav\ -\xe0B@\xf8Lz\xe4\xe0\xcc\x81\xf4\x89\xf9V\x06\xc1\ -\xb1\xb9X\x5c\xadV[\xb7M\xf3\xe7\xd0\xb4~\xdb\xd4\ -\xfc\xc5\x9ez=F\x904SFPr1 \xf4\x03\ - \xb8\x00\xb3\xb5\xb5\xb5\x14\x13HFR:1\x10\xcb\ -0\xbe\x89 #\x18z\x14\x03HZ\x01\x92\x9c+X\ -\xb4\x0c\x02!\xe5\xa6\x04\xc9\xcc\xd4\x11\xa4\x11\xaf\x11Q\ -\x03\xd3\xfc<\x05Hf\xa6n\xf0 \xbd\x9e\xa1rE\ -.\xfc\xbea\xbe\x0c\x01\x92\x9e\xb9\x1b\x81\xb5\xc2\x9c\x0a\ -\xda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- z\xabug&\x10\xb0_\xe5\x86\xdc\xad\xc2\x80\xc8\ -\xdd\x8b\xcb\xdd+\x12v\x83=\xf91\x10\xe6\x90|]\ -\x18\x10\xc7\x95F\xe3\x96\x0c\x02\xa7\x92}I\xa1h\xb7\ -\x10\x9e\xec\xa4 h\x0e*W\xdc\x8drv\xb5\xe1\xf5\ -k\x11)\x18\x12D\xb9\xaf$Z+r\xcb\x15\xdb\xad\ -\x1c\xb5Zm),\x88\xaa\x1d\x07\xb5\xe2\xa9\xdf4\xf2\ -\x91\x04\x10~\xe3HD\x10\xe7\xde\x1c\xc6\x1dY\xf2\xa9\ -y\x88\xa8 s\x1b*\x10\x1c;\x93?\xf0\xd1F9\ -D\xd2-\xf5/\xf7\x98Zhx\x8a\xa0e\x00\x00\x00\ -\x00IEND\xaeB`\x82\ -\x00\x00\x0b\xb0\ -/\ -/ Copyright (C) \ -2013 BlackBerry \ -Limited. All rig\ -hts reserved.\x0a//\ - Copyright (C) 2\ -023 The Qt Compa\ -ny Ltd.\x0a// SPDX-\ -License-Identifi\ -er: LicenseRef-Q\ -t-Commercial OR \ -BSD-3-Clause\x0a\x0aim\ -port QtQuick 2.0\ -\x0a\x0aRectangle {\x0a \ - width: 300\x0a \ - height: 600\x0a\x0a \ - Component.onCo\ -mpleted: {\x0a \ - // Loading th\ -is page may take\ - longer than QLE\ -Controller\x0a \ - // stopping w\ -ith an error, go\ - back and readju\ -st this view\x0a \ - // based on\ - controller erro\ -rs\x0a if (d\ -evice.controller\ -_error) {\x0a \ - info.visib\ -le = false;\x0a \ - menu.men\ -uText = device.u\ -pdate\x0a }\x0a\ - }\x0a\x0a Heade\ -r {\x0a id: \ -header\x0a a\ -nchors.top: pare\ -nt.top\x0a h\ -eaderText: \x22Serv\ -ices list\x22\x0a }\ -\x0a\x0a Dialog {\x0a \ - id: info\x0a\ - anchors.\ -centerIn: parent\ -\x0a visible\ -: true\x0a d\ -ialogText: \x22Scan\ -ning for service\ -s...\x22;\x0a }\x0a\x0a \ - Connections {\x0a\ - target: \ -device\x0a f\ -unction onservic\ -es_updated() {\x0a \ - if (s\ -ervicesview.coun\ -t === 0)\x0a \ - info.di\ -alogText = \x22No s\ -ervices found\x22\x0a \ - else\x0a\ - \ -info.visible = f\ -alse;\x0a }\x0a\ -\x0a functio\ -n onDisconnected\ -() {\x0a \ - pageLoader.sour\ -ce = \x22qrc:/asset\ -s/main.qml\x22\x0a \ - }\x0a }\x0a\x0a \ - ListView {\x0a \ - id: services\ -view\x0a wid\ -th: parent.width\ -\x0a anchors\ -.top: header.bot\ -tom\x0a anch\ -ors.bottom: menu\ -.top\x0a mod\ -el: device.servi\ -ces_list\x0a \ - clip: true\x0a\x0a \ - delegate: R\ -ectangle {\x0a \ - id: servi\ -cebox\x0a \ - height:100\x0a \ - color: \ -\x22lightsteelblue\x22\ -\x0a bor\ -der.width: 2\x0a \ - border.\ -color: \x22black\x22\x0a \ - radiu\ -s: 5\x0a \ - width: services\ -view.width\x0a \ - Component\ -.onCompleted: {\x0a\ - \ -info.visible = f\ -alse\x0a \ - }\x0a\x0a \ -MouseArea {\x0a \ - anch\ -ors.fill: parent\ -\x0a \ - onClicked: {\x0a \ - \ - pageLoader.sou\ -rce = \x22qrc:/asse\ -ts/Characteristi\ -cs.qml\x22;\x0a \ - dev\ -ice.connect_to_s\ -ervice(modelData\ -.service_uuid);\x0a\ - \ -}\x0a }\x0a\ -\x0a Lab\ -el {\x0a \ - id: service\ -_name\x0a \ - textConten\ -t: modelData.ser\ -vice_name\x0a \ - anchor\ -s.top: parent.to\ -p\x0a \ - anchors.topMar\ -gin: 5\x0a \ - }\x0a\x0a \ - Label {\x0a \ - textCo\ -ntent: modelData\ -.service_type\x0a \ - fo\ -nt.pointSize: se\ -rvice_name.font.\ -pointSize * 0.5\x0a\ - \ -anchors.top: ser\ -vice_name.bottom\ -\x0a }\x0a\x0a\ - Labe\ -l {\x0a \ - id: service_\ -uuid\x0a \ - font.pointS\ -ize: service_nam\ -e.font.pointSize\ - * 0.5\x0a \ - textConte\ -nt: modelData.se\ -rvice_uuid\x0a \ - ancho\ -rs.bottom: servi\ -cebox.bottom\x0a \ - anc\ -hors.bottomMargi\ -n: 5\x0a \ - }\x0a }\x0a \ - }\x0a\x0a Menu {\x0a \ - id: menu\x0a\ - anchors.\ -bottom: parent.b\ -ottom\x0a me\ -nuWidth: parent.\ -width\x0a me\ -nuText: device.u\ -pdate\x0a me\ -nuHeight: (paren\ -t.height/6)\x0a \ - onButtonClic\ -k: {\x0a \ - device.disconne\ -ct_from_device()\ -\x0a pag\ -eLoader.source =\ - \x22qrc:/assets/ma\ -in.qml\x22\x0a \ - device.updat\ -e = \x22Search\x22\x0a \ - }\x0a }\x0a}\x0a\ -\x00\x00\x01\xb5\ -/\ -/ Copyright (C) \ -2013 BlackBerry \ -Limited. All rig\ -hts reserved.\x0a//\ - SPDX-License-Id\ -entifier: Licens\ -eRef-Qt-Commerci\ -al OR BSD-3-Clau\ -se\x0a\x0aimport QtQui\ -ck 2.0\x0a\x0aText {\x0a \ - property stri\ -ng textContent: \ -\x22\x22\x0a font.poin\ -tSize: 20\x0a an\ -chors.horizontal\ -Center: parent.h\ -orizontalCenter\x0a\ - color: \x22#363\ -636\x22\x0a horizon\ -talAlignment: Te\ -xt.AlignHCenter\x0a\ - elide: Text.\ -ElideMiddle\x0a \ -width: parent.wi\ -dth\x0a wrapMode\ -: Text.Wrap\x0a \ -text: textConten\ -t\x0a}\x0a\ -\x00\x00\x04\x8a\ -/\ -/ Copyright (C) \ -2013 BlackBerry \ -Limited. All rig\ -hts reserved.\x0a//\ - SPDX-License-Id\ -entifier: Licens\ -eRef-Qt-Commerci\ -al OR BSD-3-Clau\ -se\x0a\x0aimport QtQui\ -ck 2.0\x0a\x0aRectangl\ -e {\x0a width: p\ -arent.width/3*2\x0a\ - height: dial\ -ogTextId.height \ -+ background.hei\ -ght + 20\x0a z: \ -50\x0a property \ -string dialogTex\ -t: \x22\x22\x0a proper\ -ty bool busyImag\ -e: true\x0a bord\ -er.width: 1\x0a \ -border.color: \x22#\ -363636\x22\x0a radi\ -us: 10\x0a\x0a Text\ - {\x0a id: d\ -ialogTextId\x0a \ - horizontalAl\ -ignment: Text.Al\ -ignHCenter\x0a \ - verticalAlign\ -ment: Text.Align\ -VCenter\x0a \ -anchors.horizont\ -alCenter: parent\ -.horizontalCente\ -r\x0a anchor\ -s.top: parent.to\ -p;\x0a ancho\ -rs.topMargin: 10\ -\x0a\x0a elide:\ - Text.ElideMiddl\ -e\x0a text: \ -dialogText\x0a \ - color: \x22#3636\ -36\x22\x0a wrap\ -Mode: Text.Wrap\x0a\ - }\x0a\x0a Image\ - {\x0a id: b\ -ackground\x0a\x0a \ - width:20\x0a \ - height:20\x0a \ - anchors.to\ -p: dialogTextId.\ -bottom\x0a a\ -nchors.horizonta\ -lCenter: dialogT\ -extId.horizontal\ -Center\x0a v\ -isible: parent.b\ -usyImage\x0a \ - source: \x22qrc:/a\ -ssets/busy_dark.\ -png\x22\x0a fil\ -lMode: Image.Pre\ -serveAspectFit\x0a \ - NumberAni\ -mation on rotati\ -on { duration: 3\ -000; from:0; to:\ - 360; loops: Ani\ -mation.Infinite}\ -\x0a }\x0a}\x0a\ -\x00\x00\x05<\ -/\ -/ Copyright (C) \ -2013 BlackBerry \ -Limited. All rig\ -hts reserved.\x0a//\ - Copyright (C) 2\ -023 The Qt Compa\ -ny Ltd.\x0a// SPDX-\ -License-Identifi\ -er: LicenseRef-Q\ -t-Commercial OR \ -BSD-3-Clause\x0a\x0aim\ -port QtQuick 2.0\ -\x0a\x0aRectangle {\x0a\x0a \ - property real\ - menuWidth: 100\x0a\ - property rea\ -l menuHeight: 50\ -\x0a property st\ -ring menuText: \x22\ -Search\x22\x0a sign\ -al buttonClick()\ -\x0a\x0a height: me\ -nuHeight\x0a wid\ -th: menuWidth\x0a\x0a \ - Rectangle {\x0a \ - id: searc\ -h\x0a width:\ - parent.width\x0a \ - height: pa\ -rent.height\x0a \ - anchors.cent\ -erIn: parent\x0a \ - color: \x22#36\ -3636\x22\x0a bo\ -rder.width: 1\x0a \ - border.col\ -or: \x22#E3E3E3\x22\x0a \ - radius: 5\x0a\ - Text {\x0a \ - id: s\ -earchText\x0a \ - horizontal\ -Alignment: Text.\ -AlignHCenter\x0a \ - vertica\ -lAlignment: Text\ -.AlignVCenter\x0a \ - anchor\ -s.fill: parent\x0a \ - text:\ - menuText\x0a \ - elide: Tex\ -t.ElideMiddle\x0a \ - color:\ - \x22#E3E3E3\x22\x0a \ - wrapMode:\ - Text.WordWrap\x0a \ - }\x0a\x0a \ - MouseArea {\x0a \ - anchor\ -s.fill: parent\x0a \ - onPre\ -ssed: {\x0a \ - search.w\ -idth = search.wi\ -dth - 7\x0a \ - search.h\ -eight = search.h\ -eight - 5\x0a \ - }\x0a\x0a \ - onReleased:\ - {\x0a \ - search.width \ -= search.width +\ - 7\x0a \ - search.height\ - = search.height\ - + 5\x0a \ - }\x0a\x0a \ -onClicked: {\x0a \ - but\ -tonClick()\x0a \ - }\x0a \ - }\x0a }\x0a}\x0a\ -\x00\x00\x03l\ -\x00\ -\x00\x0c\xf8x\xda\xc5WKs\xda0\x10\xbe\xfbWh\ -|\x22\xed h2Mg\xdc\xc9!\xc0!\x99!m\ -\x132io\x19a/\xa0\x89,9\x92L\x1e\x9d\xfc\ -\xf7\xael\xf3\x90m\xd2&\x07\xea\x03\xe0\xd5>?\xed\ -\x8b^\x8f\x0cU\xf6\xa4\xf9|aIgx@\x0e\xfb\ -\x9f\x8e\xc8@\xb0\xf8n\x00Z?\x911O\xb9\x85\x84\ -\x92S!H\xc1f\x88\x06\x03z\x89\xc4\xa0\xd7\x14?\ -<\x22\xd7\x0b \x97\x16O\xd2\x8cITaK\xce\xc9\ -\x8f\xd1\xaf\xee\x98\xc7 \x0dt\xcf\x13\x90\x96\xcf8\xe8\ -\x88T\xb4+\x98u/m\x17\xc5R\xd01g\x82|\ -\xbf\x22\x83\xc9\xa8{\xd4\x1d\x0a\x96\x1b\x08\x02\x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c4*\x05i-\xdf\x5cim\xcc\ -!#\xcc1\xff\x22R\xef\x01\xbb\xe3\x9b\xaaG\x8f\xa3\ -j\x0f\xabnQ\x8b\xbc%A}\x14\x0a$\x94P\xd8\ -\xc5BQtG\x0b \xa6\x22\x07?\xff\xa6J;0\ -*\xb5\x87mg+5S\xd1\xa8\x15\xcd\x12\x9e\x9b\x88\ -|\x0e<\xf2\x98MA\xb4%k#\xea[\xc9\xd2f\ -\xbeZ\xac l\x04\x16/7*q\x1f1\xcb\xe8\xbf\ -\x88\xfe\xadA\xb6\xf0]`s\xe1\xd2\x05\xe1W\xc4{\ -C\xcas\x9e4\xf8f\x18\x0e\xcd\x14\x97v\xc2\x9f\xa1\ -\x15\x06\xea\xf3|\xe8\xd3/\xefD\xa6\xd5\x03\x0f\x996\ -\xf3\xb5\x82\xd8\x03RK&r\xd8\x0bT\x9d\xf0\xc6\xd9\ -\xc2,&\x1fw\xe3V\xf8s\xb0\x13\x81Uk\xf0\xa5\ -\xce\x98L\x04\xb4&\x19J\xf1gt\x81\x89S\xacA\ -\x99\x16\xae\xb8\xf1@\x8b\xf7\xb3a1U\xf7\x88x\xe9\ -\xeb\x9e\x10/\x8di\xf3:\xe8%\xd7[A\xbf\xcd@\ -\xa7\xdc\x18\x9cN\xfb.\xef\x8d\xe5\xff[\xe4\xaf\xf8Q\ -\xc7\xae\xea\x83\xef-\xf0\xa6\xca]\x98\xb6\x8e\xf7\x0b\x9c\ -\xa4\xb5\xd1\xee\x86k\xf06o\x9d\xc8\xcfW\xc6\xfej\ -\xa9[O\xe8r\x05\xf4\xce\xcf\xaa\x95\xbbSi(g\ -l\xefx\x93}J\x0er4+\x87\x02\xd7\xf8\xe8\xad\ -{\xce\x04\xff}\xa0i\xe3\xef:\xe5F\xb0\xe5Ss\ -\xef\x5c\xe1\xf5\x12\xfc\x01\xe3\xbd\xadu\ -\x00\x00\x02?\ -/\ -/ Copyright (C) \ -2013 BlackBerry \ -Limited. All rig\ -hts reserved.\x0a//\ - SPDX-License-Id\ -entifier: Licens\ -eRef-Qt-Commerci\ -al OR BSD-3-Clau\ -se\x0a\x0aimport QtQui\ -ck 2.0\x0a\x0aRectangl\ -e {\x0a width: p\ -arent.width\x0a \ -height: 70\x0a b\ -order.width: 1\x0a \ - border.color:\ - \x22#363636\x22\x0a r\ -adius: 5\x0a pro\ -perty string hea\ -derText: \x22\x22\x0a\x0a \ - Text {\x0a \ -horizontalAlignm\ -ent: Text.AlignH\ -Center\x0a v\ -erticalAlignment\ -: Text.AlignVCen\ -ter\x0a anch\ -ors.fill: parent\ -\x0a text: h\ -eaderText\x0a \ - font.bold: tru\ -e\x0a font.p\ -ointSize: 20\x0a \ - elide: Text\ -.ElideMiddle\x0a \ - color: \x22#36\ -3636\x22\x0a }\x0a}\x0a\ -\x00\x00\x0b\x96\ -/\ -/ Copyright (C) \ -2013 BlackBerry \ -Limited. All rig\ -hts reserved.\x0a//\ - Copyright (C) 2\ -023 The Qt Compa\ -ny Ltd.\x0a// SPDX-\ -License-Identifi\ -er: LicenseRef-Q\ -t-Commercial OR \ -BSD-3-Clause\x0a\x0aim\ -port QtQuick\x0a\x0aRe\ -ctangle {\x0a id\ -: back\x0a width\ -: 300\x0a height\ -: 600\x0a proper\ -ty bool deviceSt\ -ate: device.stat\ -e\x0a onDevicest\ -ate_changed: {\x0a \ - if (!devi\ -ce.state)\x0a \ - info.visib\ -le = false;\x0a \ -}\x0a\x0a Header {\x0a\ - id: head\ -er\x0a ancho\ -rs.top: parent.t\ -op\x0a heade\ -rText: \x22Start Di\ -scovery\x22\x0a }\x0a\x0a\ - Dialog {\x0a \ - id: info\x0a \ - anchors.ce\ -nterIn: parent\x0a \ - visible: \ -false\x0a }\x0a\x0a \ - ListView {\x0a \ - id: theListV\ -iew\x0a widt\ -h: parent.width\x0a\ - clip: tr\ -ue\x0a\x0a anch\ -ors.top: header.\ -bottom\x0a a\ -nchors.bottom: c\ -onnectToggle.top\ -\x0a model: \ -device.devices_l\ -ist\x0a\x0a del\ -egate: Rectangle\ - {\x0a i\ -d: box\x0a \ - height:100\x0a \ - width:\ - theListView.wid\ -th\x0a c\ -olor: \x22lightstee\ -lblue\x22\x0a \ - border.width:\ - 2\x0a b\ -order.color: \x22bl\ -ack\x22\x0a \ - radius: 5\x0a\x0a \ - Componen\ -t.onCompleted: {\ -\x0a \ - info.visible = \ -false;\x0a \ - header.he\ -aderText = \x22Sele\ -ct a device\x22;\x0a \ - }\x0a\x0a \ - MouseAr\ -ea {\x0a \ - anchors.fil\ -l: parent\x0a \ - onClic\ -ked: {\x0a \ - devic\ -e.scan_services(\ -modelData.device\ -_address);\x0a \ - p\ -ageLoader.source\ - = \x22qrc:/assets/\ -Services.qml\x22\x0a \ - }\x0a\ - }\x0a\x0a \ - Label\ - {\x0a \ - id: device_na\ -me\x0a \ - textContent: \ -modelData.device\ -_name\x0a \ - anchors.to\ -p: parent.top\x0a \ - an\ -chors.topMargin:\ - 5\x0a }\ -\x0a\x0a La\ -bel {\x0a \ - id: device\ -_address\x0a \ - textCon\ -tent: modelData.\ -device_address\x0a \ - f\ -ont.pointSize: d\ -evice_name.font.\ -pointSize*0.7\x0a \ - an\ -chors.bottom: bo\ -x.bottom\x0a \ - anchors\ -.bottomMargin: 5\ -\x0a }\x0a \ - }\x0a }\x0a\x0a\ - Menu {\x0a \ - id: connectTo\ -ggle\x0a\x0a me\ -nuWidth: parent.\ -width\x0a an\ -chors.bottom: me\ -nu.top\x0a m\ -enuText: { if (d\ -evice.devices_li\ -st.length)\x0a \ - \ - visible = tru\ -e\x0a \ - else\x0a \ - \ - visible = fal\ -se\x0a \ - if (devic\ -e.use_random_add\ -ress)\x0a \ - \x22A\ -ddress type: Ran\ -dom\x22\x0a \ - else\x0a \ - \ - \x22Address t\ -ype: Public\x22\x0a \ - }\x0a\x0a \ -onButtonClick: d\ -evice.use_random\ -_address = !devi\ -ce.use_random_ad\ -dress;\x0a }\x0a\x0a \ - Menu {\x0a \ - id: menu\x0a \ - anchors.bottom\ -: parent.bottom\x0a\ - menuWidt\ -h: parent.width\x0a\ - menuHeig\ -ht: (parent.heig\ -ht/6)\x0a me\ -nuText: device.u\ -pdate\x0a on\ -ButtonClick: {\x0a \ - devic\ -e.start_device_d\ -iscovery();\x0a \ - // if st\ -art_device_disco\ -very() failed de\ -vice.state is no\ -t set\x0a \ - if (device.sta\ -te) {\x0a \ - info.dialo\ -gText = \x22Searchi\ -ng...\x22;\x0a \ - info.vis\ -ible = true;\x0a \ - }\x0a \ - }\x0a }\x0a\x0a \ -Loader {\x0a \ - id: pageLoader\x0a\ - anchors.\ -fill: parent\x0a \ - }\x0a}\x0a\ -" - -qt_resource_name = b"\ -\x00\x06\ -\x06\x8a\x9c\xb3\ -\x00a\ -\x00s\x00s\x00e\x00t\x00s\ -\x00\x0d\ -\x0b\x1b\xbd\xa7\ -\x00b\ -\x00u\x00s\x00y\x00_\x00d\x00a\x00r\x00k\x00.\x00p\x00n\x00g\ -\x00\x0c\ -\x02\xffq\xdc\ -\x00S\ -\x00e\x00r\x00v\x00i\x00c\x00e\x00s\x00.\x00q\x00m\x00l\ -\x00\x09\ -\x08\xbf\xf4\xdc\ -\x00L\ -\x00a\x00b\x00e\x00l\x00.\x00q\x00m\x00l\ -\x00\x0a\ -\x03S\x0b<\ -\x00D\ -\x00i\x00a\x00l\x00o\x00g\x00.\x00q\x00m\x00l\ -\x00\x08\ -\x0cX^\x5c\ -\x00M\ -\x00e\x00n\x00u\x00.\x00q\x00m\x00l\ -\x00\x13\ -\x0d\x96a\x9c\ -\x00C\ -\x00h\x00a\x00r\x00a\x00c\x00t\x00e\x00r\x00i\x00s\x00t\x00i\x00c\x00s\x00.\x00q\ -\x00m\x00l\ -\x00\x0a\ -\x0a\xcc\x82\xdc\ -\x00H\ -\x00e\x00a\x00d\x00e\x00r\x00.\x00q\x00m\x00l\ -\x00\x08\ -\x08\x01Z\x5c\ -\x00m\ -\x00a\x00i\x00n\x00.\x00q\x00m\x00l\ -" - -qt_resource_struct = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x08\x00\x00\x00\x02\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x002\x00\x00\x00\x00\x00\x01\x00\x00\x04n\ -\x00\x00\x01\x86,\x18\xf8\xdc\ -\x00\x00\x00h\x00\x00\x00\x00\x00\x01\x00\x00\x11\xdb\ -\x00\x00\x01\x86+6\xb9\xe8\ -\x00\x00\x00\xde\x00\x00\x00\x00\x00\x01\x00\x00!\x5c\ -\x00\x00\x01\x86,\x17\xd4$\ -\x00\x00\x00P\x00\x00\x00\x00\x00\x01\x00\x00\x10\x22\ -\x00\x00\x01\x86+6\xb9\xe8\ -\x00\x00\x00\xc4\x00\x00\x00\x00\x00\x01\x00\x00\x1f\x19\ -\x00\x00\x01\x86+6\xb9\xe8\ -\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x86+6\xb9\xe8\ -\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x16i\ -\x00\x00\x01\x86+6\xb9\xe8\ -\x00\x00\x00\x98\x00\x01\x00\x00\x00\x01\x00\x00\x1b\xa9\ -\x00\x00\x01\x86+\xfa\xf9\x12\ -" - -def qInitResources(): - QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() diff --git a/examples/bluetooth/lowenergyscanner/resources.qrc b/examples/bluetooth/lowenergyscanner/resources.qrc deleted file mode 100644 index c24866534..000000000 --- a/examples/bluetooth/lowenergyscanner/resources.qrc +++ /dev/null @@ -1,12 +0,0 @@ -<RCC> - <qresource> - <file>assets/Characteristics.qml</file> - <file>assets/main.qml</file> - <file>assets/Menu.qml</file> - <file>assets/Services.qml</file> - <file>assets/Header.qml</file> - <file>assets/Dialog.qml</file> - <file>assets/Label.qml</file> - <file>assets/busy_dark.png</file> - </qresource> -</RCC> |