diff options
author | Tim Blechmann <tim.blechmann@qt.io> | 2025-06-20 14:46:01 +0800 |
---|---|---|
committer | Tim Blechmann <tim.blechmann@qt.io> | 2025-08-11 01:49:33 +0000 |
commit | 38b3e0dfee4999d1d7d78385fbbd5373a52f7fe4 (patch) | |
tree | ca1f2d6c9d86d4e90408e8c3444ba25f3e060d7b | |
parent | 132e9ce795188582e61533691963d51a2facc6eb (diff) |
QObject::connect needs to be called with a context object.
Pick-to: 6.10
Change-Id: I7aa6c6c9c658770848788b063c0127051a8a000a
Reviewed-by: Brett Stottlemyer <brett.stottlemyer@gmail.com>
-rw-r--r-- | tests/manual/examples/ble/bleclient/connectpage.cpp | 2 | ||||
-rw-r--r-- | tests/manual/examples/ble/bleserver/main.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/manual/examples/ble/bleclient/connectpage.cpp b/tests/manual/examples/ble/bleclient/connectpage.cpp index 78ea1b7..9d387b5 100644 --- a/tests/manual/examples/ble/bleclient/connectpage.cpp +++ b/tests/manual/examples/ble/bleclient/connectpage.cpp @@ -202,7 +202,7 @@ void ConnectPage::connectNode() } }); - QObject::connect(m_service, &QLowEnergyService::errorOccurred, [this] + QObject::connect(m_service, &QLowEnergyService::errorOccurred, this, [this] (QLowEnergyService::ServiceError error) { if (error == QLowEnergyService::ServiceError::DescriptorWriteError) m_controller->disconnectFromDevice(); diff --git a/tests/manual/examples/ble/bleserver/main.cpp b/tests/manual/examples/ble/bleserver/main.cpp index 0e0904b..a29bccd 100644 --- a/tests/manual/examples/ble/bleserver/main.cpp +++ b/tests/manual/examples/ble/bleserver/main.cpp @@ -110,7 +110,8 @@ int main(int argc, char *argv[]) } }; - QObject::connect(bleController.get(), &QLowEnergyController::disconnected, [&]() { + QObject::connect(bleController.get(), &QLowEnergyController::disconnected, bleController.get(), + [&]() { // Upon disconnection the underlying BLE service used by the ioDevice becomes // obsolete. Free up the resources, resume advertising and wait for a new client hostNode.reset(nullptr); @@ -140,7 +141,8 @@ int main(int argc, char *argv[]) // 2) Wait for client to indicate it is fully ready // 3) Create RO sourcenode and BLE IO device QMetaObject::Connection readConnection; - QObject::connect(bleController.get(), &QLowEnergyController::connected, [&]() { + QObject::connect(bleController.get(), &QLowEnergyController::connected, bleController.get(), + [&]() { Q_ASSERT(!hostNode); Q_ASSERT(!ioDevice); readConnection = QObject::connect(sppService.get(), |