diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2023-03-23 15:20:40 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2023-03-28 09:37:11 +0200 |
commit | ca681cd1b3a51d10106a1287a98c5590100feb6a (patch) | |
tree | 2bbba40b16f2b7862368f59544d2577eedf06cfe /examples/bluetooth/heartrate-server/CMakeLists.txt | |
parent | b72c83bfecc5d259ef0fcf20cb05d2464a7fd0ab (diff) | |
download | qtconnectivity-ca681cd1b3a51d10106a1287a98c5590100feb6a.tar.gz |
LowEnergyScanner example: refactor QML code
Adapt the QML code to modern guidelines:
* properly create a QML module in CMake and qmake
* use versionless imports
* convert the Device class to QML_SINGLETON instead of injecting it
into the root context
* use QQmlApplicationEngine::loadFromModule() to start the app
The last change actually requires that we use Window instead of a
Rectangle for the Main.qml page. This, in turn, breaks the pre-existing
Loader logic, because every time we load the Main.qml page, a new
window is created. Apart from that, we get unqualified access warnings
from qmllint, because loader is accessed from every QML element, while
it is only defined in the Main.qml.
To fix that, we introduce a new page for device scan, and convert
Main.qml to use StackLayout instead of a Loader to avoid unqualified
access warnings. While on it, also fix other qmllint warnings and
re-format the QML files.
Task-number: QTBUG-111972
Pick-to: 6.5 6.5.0
Change-Id: Ia83cda08bf9547f5c2e335cb090c15d776f1b6ad
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Diffstat (limited to 'examples/bluetooth/heartrate-server/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions