diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2022-08-16 13:32:04 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-17 05:59:55 +0000 |
commit | c4ee6754d7cc7132e031e645469cc392a354cf77 (patch) | |
tree | 503da6ce19b24c53bb1bab8b91434ea3d58895f9 | |
parent | 40357f4c3b26ffb0ca0696eefcf0ac8dbfe03889 (diff) |
Bluetooth heartrate example: increase scan time and remove QML warnings
Increase the time for device discovery as it often takes more than
5 seconds to find the devices.
Introduce formal function parameters to QML signal handler functions
to remove the related warnings.
Change-Id: I79589803a1c6082f02fa13a9e0044a7c03ef0daa
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 868d7702d6efce4e92e712bc51148b3b04596c04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/bluetooth/heartrate-game/devicefinder.cpp | 2 | ||||
-rw-r--r-- | examples/bluetooth/heartrate-game/qml/App.qml | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/bluetooth/heartrate-game/devicefinder.cpp b/examples/bluetooth/heartrate-game/devicefinder.cpp index 81c4db82..a2c71df8 100644 --- a/examples/bluetooth/heartrate-game/devicefinder.cpp +++ b/examples/bluetooth/heartrate-game/devicefinder.cpp @@ -59,7 +59,7 @@ DeviceFinder::DeviceFinder(DeviceHandler *handler, QObject *parent): { //! [devicediscovery-1] m_deviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(this); - m_deviceDiscoveryAgent->setLowEnergyDiscoveryTimeout(5000); + m_deviceDiscoveryAgent->setLowEnergyDiscoveryTimeout(15000); connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &DeviceFinder::addDevice); connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::errorOccurred, this, diff --git a/examples/bluetooth/heartrate-game/qml/App.qml b/examples/bluetooth/heartrate-game/qml/App.qml index add237a6..f7cb489f 100644 --- a/examples/bluetooth/heartrate-game/qml/App.qml +++ b/examples/bluetooth/heartrate-game/qml/App.qml @@ -84,7 +84,7 @@ Item { id: titleBar currentIndex: __currentIndex - onTitleClicked: { + onTitleClicked: (index) => { if (index < __currentIndex) pageLoader.item.close() } @@ -106,7 +106,7 @@ Item { } } - Keys.onReleased: { + Keys.onReleased: (event) => { switch (event.key) { case Qt.Key_Escape: case Qt.Key_Back: { |