From 819f42dca8610c8f79477b9ce598fcf674efca45 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Tue, 16 Aug 2022 13:32:04 +0300 Subject: 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 (cherry picked from commit 868d7702d6efce4e92e712bc51148b3b04596c04) Reviewed-by: Qt Cherry-pick Bot --- examples/bluetooth/heartrate-game/devicefinder.cpp | 2 +- examples/bluetooth/heartrate-game/qml/App.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/bluetooth/heartrate-game') diff --git a/examples/bluetooth/heartrate-game/devicefinder.cpp b/examples/bluetooth/heartrate-game/devicefinder.cpp index 1b7845c6..54dbd2bb 100644 --- a/examples/bluetooth/heartrate-game/devicefinder.cpp +++ b/examples/bluetooth/heartrate-game/devicefinder.cpp @@ -12,7 +12,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 e1beff89..1eb53202 100644 --- a/examples/bluetooth/heartrate-game/qml/App.qml +++ b/examples/bluetooth/heartrate-game/qml/App.qml @@ -37,7 +37,7 @@ Item { id: titleBar currentIndex: __currentIndex - onTitleClicked: { + onTitleClicked: (index) => { if (index < __currentIndex) pageLoader.item.close() } @@ -59,7 +59,7 @@ Item { } } - Keys.onReleased: { + Keys.onReleased: (event) => { switch (event.key) { case Qt.Key_Escape: case Qt.Key_Back: { -- cgit v1.2.3