summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/bluetooth/heartrate-game/devicehandler.cpp2
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp2
-rw-r--r--src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp2
-rw-r--r--tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp2
-rw-r--r--tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/examples/bluetooth/heartrate-game/devicehandler.cpp b/examples/bluetooth/heartrate-game/devicehandler.cpp
index 3d263a4c..3bbadd7e 100644
--- a/examples/bluetooth/heartrate-game/devicehandler.cpp
+++ b/examples/bluetooth/heartrate-game/devicehandler.cpp
@@ -115,7 +115,7 @@ void DeviceHandler::setDevice(DeviceInfo *device)
// Make connections
//! [Connect-Signals-1]
- m_control = new QLowEnergyController(m_currentDevice->getDevice(), this);
+ m_control = QLowEnergyController::createCentral(m_currentDevice->getDevice(), this);
//! [Connect-Signals-1]
m_control->setRemoteAddressType(m_addressType);
//! [Connect-Signals-2]
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index cfbf4596..4e54d1e3 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -179,7 +179,7 @@ void Device::scanServices(const QString &address)
//! [les-controller-1]
if (!controller) {
// Connecting signals and slots for connecting to LE services.
- controller = new QLowEnergyController(currentDevice.getDevice());
+ controller = QLowEnergyController::createCentral(currentDevice.getDevice());
connect(controller, &QLowEnergyController::connected,
this, &Device::deviceConnected);
connect(controller, QOverload<QLowEnergyController::Error>::of(&QLowEnergyController::error),
diff --git a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
index 2e28c3f5..a2c4d8b1 100644
--- a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
+++ b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
@@ -225,7 +225,7 @@ void MyClass::enableCharNotifications()
{
QBluetoothDeviceInfo remoteDevice;
QLowEnergyService *service;
- QLowEnergyController *control = new QLowEnergyController(remoteDevice, this);
+ QLowEnergyController *control = QLowEnergyController::createCentral(remoteDevice, this);
control->connectToDevice();
diff --git a/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp b/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp
index 1862af7f..7e191052 100644
--- a/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp
+++ b/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp
@@ -115,7 +115,7 @@ void tst_QLowEnergyCharacteristic::initTestCase()
// find first service with descriptor
QLowEnergyController *controller = 0;
for (const QBluetoothDeviceInfo &remoteDevice : qAsConst(remoteLeDevices)) {
- controller = new QLowEnergyController(remoteDevice, this);
+ controller = QLowEnergyController::createCentral(remoteDevice, this);
qDebug() << "Connecting to" << remoteDevice.name()
<< remoteDevice.address() << remoteDevice.deviceUuid();
controller->connectToDevice();
diff --git a/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp b/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp
index b6ab0e53..4e82aacd 100644
--- a/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp
+++ b/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp
@@ -106,7 +106,7 @@ void tst_QLowEnergyDescriptor::initTestCase()
// find first service with descriptor
QLowEnergyController *controller = 0;
for (const QBluetoothDeviceInfo& remoteDeviceInfo : qAsConst(remoteLeDeviceInfos)) {
- controller = new QLowEnergyController(remoteDeviceInfo, this);
+ controller = QLowEnergyController::createCentral(remoteDeviceInfo, this);
qDebug() << "Connecting to" << remoteDeviceInfo.address();
controller->connectToDevice();
QTRY_IMPL(controller->state() != QLowEnergyController::ConnectingState,