summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-08-16 13:32:04 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2022-08-17 08:34:33 +0300
commit868d7702d6efce4e92e712bc51148b3b04596c04 (patch)
tree51de5d3ffc074f18b2aaa94788f554eab42bacea
parent94cf544ab0590b9f38fda8875f678ca7dcdb1a7b (diff)
downloadqtconnectivity-868d7702d6efce4e92e712bc51148b3b04596c04.tar.gz
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. Pick-to: 6.3 6.4 Change-Id: I79589803a1c6082f02fa13a9e0044a7c03ef0daa Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r--examples/bluetooth/heartrate-game/devicefinder.cpp2
-rw-r--r--examples/bluetooth/heartrate-game/qml/App.qml4
2 files changed, 3 insertions, 3 deletions
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: {