Qt6: use the newer createCentral() API

This will cause us problems when using Qt6 on Android - but I don't see
this happening any time soon.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-02-14 12:52:02 -08:00
parent 240b2dc4df
commit 300248f446

View file

@ -561,7 +561,7 @@ dc_status_t qt_ble_open(void **io, dc_context_t *, const char *devaddr, device_d
// HACK ALERT! Qt 5.9 needs this for proper Bluez operation
qputenv("QT_DEFAULT_CENTRAL_SERVICES", "1");
#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QBluetoothDeviceInfo remoteDevice = getBtDeviceInfo(QString(devaddr));
QLowEnergyController *controller = QLowEnergyController::createCentral(remoteDevice);
#else