diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2021-03-16 20:09:11 +0100 |
---|---|---|
committer | Andreas Buhr <andreas.buhr@qt.io> | 2021-03-22 13:51:28 +0100 |
commit | 75c3a3ee9fd13fe3717b93d575cd7a72415d0bdd (patch) | |
tree | f6131b91438e958dc0b1e6788b32f8ea72dadac2 /examples | |
parent | 50311fdd2da129645a8452b7bf644c332ff3808a (diff) |
rename error signals to errorOccurred
Currently, there is a name clash between the error getter and
the error signal. This leads to extensive use of qOverload or
similar. This patch renames all error signals to errorOccurred
to resolve this.
Task-number: QTBUG-62877
Change-Id: I615e2405f855433b6e142d820072c4d3f35ae28f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/bluetooth/btchat/chatclient.cpp | 4 | ||||
-rw-r--r-- | examples/bluetooth/heartrate-game/devicefinder.cpp | 4 | ||||
-rw-r--r-- | examples/bluetooth/heartrate-game/devicehandler.cpp | 10 | ||||
-rw-r--r-- | examples/bluetooth/lowenergyscanner/device.cpp | 7 | ||||
-rw-r--r-- | examples/bluetooth/pingpong/pingpong.cpp | 10 |
5 files changed, 15 insertions, 20 deletions
diff --git a/examples/bluetooth/btchat/chatclient.cpp b/examples/bluetooth/btchat/chatclient.cpp index 09946765..b6c85488 100644 --- a/examples/bluetooth/btchat/chatclient.cpp +++ b/examples/bluetooth/btchat/chatclient.cpp @@ -77,9 +77,7 @@ void ChatClient::startClient(const QBluetoothServiceInfo &remoteService) connect(socket, &QBluetoothSocket::readyRead, this, &ChatClient::readSocket); connect(socket, &QBluetoothSocket::connected, this, QOverload<>::of(&ChatClient::connected)); connect(socket, &QBluetoothSocket::disconnected, this, &ChatClient::disconnected); - connect(socket, QOverload<QBluetoothSocket::SocketError>::of(&QBluetoothSocket::error), - this, &ChatClient::onSocketErrorOccurred); - + connect(socket, &QBluetoothSocket::errorOccurred, this, &ChatClient::onSocketErrorOccurred); } //! [startClient] diff --git a/examples/bluetooth/heartrate-game/devicefinder.cpp b/examples/bluetooth/heartrate-game/devicefinder.cpp index 19ebee90..c63327f6 100644 --- a/examples/bluetooth/heartrate-game/devicefinder.cpp +++ b/examples/bluetooth/heartrate-game/devicefinder.cpp @@ -61,8 +61,8 @@ DeviceFinder::DeviceFinder(DeviceHandler *handler, QObject *parent): m_deviceDiscoveryAgent->setLowEnergyDiscoveryTimeout(5000); connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &DeviceFinder::addDevice); - connect(m_deviceDiscoveryAgent, static_cast<void (QBluetoothDeviceDiscoveryAgent::*)(QBluetoothDeviceDiscoveryAgent::Error)>(&QBluetoothDeviceDiscoveryAgent::error), - this, &DeviceFinder::scanError); + connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::errorOccurred, this, + &DeviceFinder::scanError); connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished, this, &DeviceFinder::scanFinished); connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::canceled, this, &DeviceFinder::scanFinished); diff --git a/examples/bluetooth/heartrate-game/devicehandler.cpp b/examples/bluetooth/heartrate-game/devicehandler.cpp index 96d93044..16e94577 100644 --- a/examples/bluetooth/heartrate-game/devicehandler.cpp +++ b/examples/bluetooth/heartrate-game/devicehandler.cpp @@ -121,11 +121,11 @@ void DeviceHandler::setDevice(DeviceInfo *device) connect(m_control, &QLowEnergyController::discoveryFinished, this, &DeviceHandler::serviceScanDone); - connect(m_control, static_cast<void (QLowEnergyController::*)(QLowEnergyController::Error)>(&QLowEnergyController::error), - this, [this](QLowEnergyController::Error error) { - Q_UNUSED(error); - setError("Cannot connect to remote device."); - }); + connect(m_control, &QLowEnergyController::errorOccurred, this, + [this](QLowEnergyController::Error error) { + Q_UNUSED(error); + setError("Cannot connect to remote device."); + }); connect(m_control, &QLowEnergyController::connected, this, [this]() { setInfo("Controller connected. Search services..."); m_control->discoverServices(); diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp index 3c695970..be3f3103 100644 --- a/examples/bluetooth/lowenergyscanner/device.cpp +++ b/examples/bluetooth/lowenergyscanner/device.cpp @@ -68,8 +68,8 @@ Device::Device() discoveryAgent->setLowEnergyDiscoveryTimeout(5000); connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &Device::addDevice); - connect(discoveryAgent, QOverload<QBluetoothDeviceDiscoveryAgent::Error>::of(&QBluetoothDeviceDiscoveryAgent::error), - this, &Device::deviceScanError); + connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::errorOccurred, this, + &Device::deviceScanError); connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished, this, &Device::deviceScanFinished); //! [les-devicediscovery-1] @@ -188,8 +188,7 @@ void Device::scanServices(const QString &address) controller = QLowEnergyController::createCentral(currentDevice.getDevice()); connect(controller, &QLowEnergyController::connected, this, &Device::deviceConnected); - connect(controller, QOverload<QLowEnergyController::Error>::of(&QLowEnergyController::error), - this, &Device::errorReceived); + connect(controller, &QLowEnergyController::errorOccurred, this, &Device::errorReceived); connect(controller, &QLowEnergyController::disconnected, this, &Device::deviceDisconnected); connect(controller, &QLowEnergyController::serviceDiscovered, diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp index 671f673d..8787875f 100644 --- a/examples/bluetooth/pingpong/pingpong.cpp +++ b/examples/bluetooth/pingpong/pingpong.cpp @@ -269,8 +269,7 @@ void PingPong::startServer() m_serverInfo = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this); connect(m_serverInfo, &QBluetoothServer::newConnection, this, &PingPong::clientConnected); - connect(m_serverInfo, QOverload<QBluetoothServer::Error>::of(&QBluetoothServer::error), - this, &PingPong::serverError); + connect(m_serverInfo, &QBluetoothServer::errorOccurred, this, &PingPong::serverError); const QBluetoothUuid uuid(serviceUuid); m_serverInfo->listen(uuid, QStringLiteral("PingPong server")); @@ -290,8 +289,8 @@ void PingPong::startClient() this, &PingPong::addService); connect(discoveryAgent, &QBluetoothServiceDiscoveryAgent::finished, this, &PingPong::done); - connect(discoveryAgent, QOverload<QBluetoothServiceDiscoveryAgent::Error>::of(&QBluetoothServiceDiscoveryAgent::error), - this, &PingPong::serviceScanError); + connect(discoveryAgent, &QBluetoothServiceDiscoveryAgent::errorOccurred, this, + &PingPong::serviceScanError); #ifdef Q_OS_ANDROID //see QTBUG-61392 if (QtAndroid::androidSdkVersion() >= 23) discoveryAgent->setUuidFilter(QBluetoothUuid(androidUuid)); @@ -324,8 +323,7 @@ void PingPong::clientConnected() this, &PingPong::readSocket); connect(socket, &QBluetoothSocket::disconnected, this, &PingPong::clientDisconnected); - connect(socket, QOverload<QBluetoothSocket::SocketError>::of(&QBluetoothSocket::error), - this, &PingPong::socketError); + connect(socket, &QBluetoothSocket::errorOccurred, this, &PingPong::socketError); //! [Initiating server socket] setMessage(QStringLiteral("Client connected. Get ready!")); |