summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/Main.qml
Commit message (Collapse)AuthorAgeFilesLines
* LowEnergyScanner example: refactor QML codeIvan Solovev2023-03-291-0/+31
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 Change-Id: Ia83cda08bf9547f5c2e335cb090c15d776f1b6ad Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> (cherry picked from commit ca681cd1b3a51d10106a1287a98c5590100feb6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>