summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2018-01-04 14:37:52 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2018-01-04 15:06:14 +0000
commit5a67821b9615b5fc17cab405566a81cc7f554ad4 (patch)
treee439c2fb539f8b90dc76850cbd4e5e7fb9d16af6
parente46cde935ee76eaa00e78af968121502e2406347 (diff)
QtBluetooth: Fix heartrate-game for QT_PLATFORM_UIKIT
QBluetoothLocalDevice::isValid() returns false for iOS/tvOS/watchOS (because Apple does not provide any public API/Framework to implement QBluetoothLocalDevice correctly). Make ConnectionHandler::alive return true for QT_PLATFORM_UIKIT. Task-number: QTBUG-65547 Change-Id: I219fbeadc752b815f8369d332c10a24e70150abb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--examples/bluetooth/heartrate-game/connectionhandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/bluetooth/heartrate-game/connectionhandler.cpp b/examples/bluetooth/heartrate-game/connectionhandler.cpp
index 5ab85c85..3388c0a8 100644
--- a/examples/bluetooth/heartrate-game/connectionhandler.cpp
+++ b/examples/bluetooth/heartrate-game/connectionhandler.cpp
@@ -51,6 +51,7 @@
#include "heartrate-global.h"
#include "connectionhandler.h"
#include <QtBluetooth/qtbluetooth-config.h>
+#include <QtCore/qsystemdetection.h>
ConnectionHandler::ConnectionHandler(QObject *parent) : QObject(parent)
{
@@ -60,7 +61,7 @@ ConnectionHandler::ConnectionHandler(QObject *parent) : QObject(parent)
bool ConnectionHandler::alive() const
{
-#ifdef SIMULATOR
+#if defined(SIMULATOR) || defined(QT_PLATFORM_UIKIT)
return true;
#else
return m_localDevice.isValid() && m_localDevice.hostMode() != QBluetoothLocalDevice::HostPoweredOff;