summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/heartrate-game
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-08-16 13:32:04 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-17 05:59:55 +0000
commit819f42dca8610c8f79477b9ce598fcf674efca45 (patch)
tree84712bdf12a367a110ef807ea271dc74041bbf9a /examples/bluetooth/heartrate-game
parentcf1365c6ec775d46dec60edea0119d231bc0e8fd (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>
Diffstat (limited to 'examples/bluetooth/heartrate-game')
-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: {