diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2018-08-20 14:29:42 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-08-21 06:55:28 +0000 |
commit | 175dca8f8b3aff6e5659e7a40b0f2a3d241e9c3b (patch) | |
tree | 778d6534b76d1af0d9d3f103d097e8690be80528 /examples | |
parent | 322eb120c9237a390ef4d1e29605222498729803 (diff) |
Remove direct usage of QLowEnergyController::ctor
QLowEnergyController::createCentral() is the official API to do the same.
Change-Id: Idbd26d201b24add6697f6f9cdf1194511c160273
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/bluetooth/heartrate-game/devicehandler.cpp | 2 | ||||
-rw-r--r-- | examples/bluetooth/lowenergyscanner/device.cpp | 2 |
2 files changed, 2 insertions, 2 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), |