summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/lowenergyscanner.pro
Commit message (Collapse)AuthorAgeFilesLines
* Fix .plist when building an example for iOS with CMakeJuha Vuolle2023-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | When building an example for iOS with qmake (qt-cmake -GXcode) the local Info.plists of three of the examples don't work, because they were using qmake substitutions (${EXECUTABLE_NAME} instead of ${MACOSX_BUNDLE_EXECUTABLE_NAME}), which resulted in "CFBundleExecutable is not specified". Instead use shared plist files, each for CMake and qmake. One of the removed files contained NSBluetoothPeripheralUsageDescription key, which I think can be discarded now; it is intended for iOS < 13, and the minimum for Qt 6 is 13. Pick-to: 6.5 Change-Id: I901dc176c001e25ce88d42b9456b6e16d8f43c20 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* LowEnergyScanner example: refactor QML codeIvan Solovev2023-03-281-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* macOS specific Info.plist file for Bluetooth ExamplesJuha Vuolle2021-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The default generated Info.plist is not enough as the Bluetooth examples require NSBluetoothAlwaysUsageDescription key to work. Without this patch on macOS 12 there are two possible outcomes: 1) If the example is built with qmake, the application will crash and the crash report will indicate that the key is missing 2) If the example is built with CMake, the application will not start as it tries to use iOS specific .plist file The patch uses absolute paths in the example CMakeLists.txt files to work around a Ninja bug: https://gitlab.kitware.com/cmake/cmake/-/issues/20181 Using relative paths resulted in "multiple rules generate" errors if the QtConnectivity module is built with examples. Note that the plist files are only effective if the application is started as an app bundle, ie. not if launching the contained binary directly. Pick-to: 6.2 Task-number: QTBUG-98090 Change-Id: Iedb7eabbb8fde6ad1ba14ada1a7ee87ec1d708ba Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CoreBluetooth: provide a description (in Info.plist) of BT usageTimur Pocheptsov2021-09-091-0/+2
| | | | | | | | | | | Our lowenergyscanner example can be built and deployed on iOS device. As such, it has to provide an explanation, why it needs an access to BT adapter, otherwise, it would crash with the most recent versions of iOS. Pick-to: 6.2 5.15 Change-Id: Iebcdf8af931002532aada0c452263effd342300e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Lowenergyscanner example improvedNedim Hadzic2014-02-271-9/+1
| | | | | | | Error handling improved, code styling improved. Change-Id: I1f35c6a6ef9641cb445fdbe55e0127b554e50ebc Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Implemented Bluetooth Low Energy: examplesNedim Hadzic2014-01-091-0/+33
Examples which illustrate how to use BLE API are implemented. First example is an application for discovering LE devices, services and characteristics. Change-Id: Ic144c78499b74934541837df9a53183b4e7e32f7 Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>