summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@qt.io>2021-05-17 17:11:23 +0300
committerVille Voutilainen <ville.voutilainen@qt.io>2021-06-04 15:08:23 +0300
commit7d2c6ae66fd61be56b35ae0c59354b695a02d6c7 (patch)
tree5858ea994587fb7955a05674bc22efbdb0f0f3b4 /examples
parent09c8d5df77f3a5bffdf698d62ca0cf6179182060 (diff)
Remove AndroidExtras dependencies and port to new Qt 6 Android APIs
Task-number: QTBUG-93811 Change-Id: Ia3eb9ad90f27614db5997e1f41f13e050f5f4ab7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/bluetooth/btchat/CMakeLists.txt7
-rw-r--r--examples/bluetooth/btchat/btchat.pro1
-rw-r--r--examples/bluetooth/btchat/chat.cpp7
-rw-r--r--examples/bluetooth/pingpong/CMakeLists.txt7
-rw-r--r--examples/bluetooth/pingpong/pingpong.cpp6
-rw-r--r--examples/bluetooth/pingpong/pingpong.pro1
6 files changed, 4 insertions, 25 deletions
diff --git a/examples/bluetooth/btchat/CMakeLists.txt b/examples/bluetooth/btchat/CMakeLists.txt
index 5647ba94..014c9052 100644
--- a/examples/bluetooth/btchat/CMakeLists.txt
+++ b/examples/bluetooth/btchat/CMakeLists.txt
@@ -34,13 +34,6 @@ target_link_libraries(btchat PUBLIC
Qt::Widgets
)
-if(ANDROID)
- find_package(Qt6 COMPONENTS AndroidExtras)
- target_link_libraries(btchat PUBLIC
- Qt::AndroidExtras
- )
-endif()
-
install(TARGETS btchat
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/bluetooth/btchat/btchat.pro b/examples/bluetooth/btchat/btchat.pro
index 9c37dfcf..bbf9ed18 100644
--- a/examples/bluetooth/btchat/btchat.pro
+++ b/examples/bluetooth/btchat/btchat.pro
@@ -3,7 +3,6 @@ TARGET = btchat
QT = core bluetooth widgets
requires(qtConfig(listwidget))
-android: QT += androidextras
SOURCES = \
main.cpp \
diff --git a/examples/bluetooth/btchat/chat.cpp b/examples/bluetooth/btchat/chat.cpp
index cec9c900..5df2ed67 100644
--- a/examples/bluetooth/btchat/chat.cpp
+++ b/examples/bluetooth/btchat/chat.cpp
@@ -53,16 +53,13 @@
#include "chatserver.h"
#include "chatclient.h"
+#include <QCoreApplication>
#include <QtCore/qdebug.h>
#include <QtBluetooth/qbluetoothdeviceinfo.h>
#include <QtBluetooth/qbluetoothlocaldevice.h>
#include <QtBluetooth/qbluetoothuuid.h>
-#ifdef Q_OS_ANDROID
-#include <QtAndroidExtras/QtAndroid>
-#endif
-
static const QLatin1String serviceUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c8");
#ifdef Q_OS_ANDROID
static const QLatin1String reverseUuid("c8e96402-0102-cf9c-274b-701a950fe1e8");
@@ -193,7 +190,7 @@ void Chat::connectClicked()
RemoteSelector remoteSelector(adapter);
#ifdef Q_OS_ANDROID
- if (QtAndroid::androidSdkVersion() >= 23)
+ if (QNativeInterface::QAndroidApplication::sdkVersion() >= 23)
remoteSelector.startDiscovery(QBluetoothUuid(reverseUuid));
else
remoteSelector.startDiscovery(QBluetoothUuid(serviceUuid));
diff --git a/examples/bluetooth/pingpong/CMakeLists.txt b/examples/bluetooth/pingpong/CMakeLists.txt
index 6f267ebc..12d49bba 100644
--- a/examples/bluetooth/pingpong/CMakeLists.txt
+++ b/examples/bluetooth/pingpong/CMakeLists.txt
@@ -50,13 +50,6 @@ qt6_add_resources(btpingpong "resource"
${resource_resource_files}
)
-if(ANDROID)
- find_package(Qt6 COMPONENTS AndroidExtras)
- target_link_libraries(btpingpong PUBLIC
- Qt::AndroidExtras
- )
-endif()
-
install(TARGETS btpingpong
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp
index 8787875f..70992036 100644
--- a/examples/bluetooth/pingpong/pingpong.cpp
+++ b/examples/bluetooth/pingpong/pingpong.cpp
@@ -50,9 +50,7 @@
#include "pingpong.h"
#include <QDebug>
-#ifdef Q_OS_ANDROID
-#include <QtAndroid>
-#endif
+#include <QCoreApplication>
PingPong::PingPong()
{
@@ -292,7 +290,7 @@ void PingPong::startClient()
connect(discoveryAgent, &QBluetoothServiceDiscoveryAgent::errorOccurred, this,
&PingPong::serviceScanError);
#ifdef Q_OS_ANDROID //see QTBUG-61392
- if (QtAndroid::androidSdkVersion() >= 23)
+ if (QNativeInterface::QAndroidApplication::sdkVersion() >= 23)
discoveryAgent->setUuidFilter(QBluetoothUuid(androidUuid));
else
discoveryAgent->setUuidFilter(QBluetoothUuid(serviceUuid));
diff --git a/examples/bluetooth/pingpong/pingpong.pro b/examples/bluetooth/pingpong/pingpong.pro
index aa79212e..07675f27 100644
--- a/examples/bluetooth/pingpong/pingpong.pro
+++ b/examples/bluetooth/pingpong/pingpong.pro
@@ -2,7 +2,6 @@ TEMPLATE = app
TARGET = pingpong
QT += quick bluetooth
-android: QT += androidextras
# Input
SOURCES += main.cpp \