From b9502e498c1033b8334afca7808807d3b6f00926 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 11 Feb 2020 12:48:38 +0100 Subject: "Fix" heartrate-server on Android This is a workaround for QTBUG-80533. Command line applications are no longer supported on Android. As we use the heartrate examples as test cases for bluetooth, we work around this problem by instanciating a gui application which fixes the compile error on Android. Change-Id: If06767eb6ff534077f193163991d9d506c17e50e Reviewed-by: Alex Blasche --- examples/bluetooth/heartrate-server/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'examples/bluetooth/heartrate-server/main.cpp') diff --git a/examples/bluetooth/heartrate-server/main.cpp b/examples/bluetooth/heartrate-server/main.cpp index ea01d07d..7986edd6 100644 --- a/examples/bluetooth/heartrate-server/main.cpp +++ b/examples/bluetooth/heartrate-server/main.cpp @@ -57,7 +57,11 @@ #include #include #include +#ifndef Q_OS_ANDROID #include +#else +#include +#endif #include #include #include @@ -66,7 +70,11 @@ int main(int argc, char *argv[]) { //QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); +#ifndef Q_OS_ANDROID QCoreApplication app(argc, argv); +#else + QGuiApplication app(argc, argv); +#endif //! [Advertising Data] QLowEnergyAdvertisingData advertisingData; -- cgit v1.2.3