summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/btchat
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2021-03-02 12:36:01 +0100
committerAndreas Buhr <andreas@andreasbuhr.de>2021-03-12 09:05:35 +0100
commite009d67f4b12d0f63f77cfb61d58e13fe3500d93 (patch)
treef218c8ea685d9ab437b5015c88a10f9b5e2b1bd7 /examples/bluetooth/btchat
parentadc461946060ce5f4f663838b8970c7017d6f44b (diff)
Decouple QBluetoothSocket and QAbstractSocket, introduce scoped enums
QBluetoothSocket enum values were tied to QAbstractSocket enum values. But there is no dependency, the coupling is not required. This patch removes the coupling and changes to scoped enums for improved type safety. Task-number: QTBUG-62877 Change-Id: I206b1d438d74b976d3e0d32da5713d22b597dd90 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/bluetooth/btchat')
-rw-r--r--examples/bluetooth/btchat/chatclient.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/bluetooth/btchat/chatclient.cpp b/examples/bluetooth/btchat/chatclient.cpp
index a3b4ed80..09946765 100644
--- a/examples/bluetooth/btchat/chatclient.cpp
+++ b/examples/bluetooth/btchat/chatclient.cpp
@@ -115,12 +115,12 @@ void ChatClient::sendMessage(const QString &message)
void ChatClient::onSocketErrorOccurred(QBluetoothSocket::SocketError error)
{
- if (error == QBluetoothSocket::NoSocketError)
+ if (error == QBluetoothSocket::SocketError::NoSocketError)
return;
QMetaEnum metaEnum = QMetaEnum::fromType<QBluetoothSocket::SocketError>();
QString errorString = socket->peerName() + QLatin1Char(' ')
- + metaEnum.valueToKey(error) + QLatin1String(" occurred");
+ + metaEnum.valueToKey(static_cast<int>(error)) + QLatin1String(" occurred");
emit socketErrorOccurred(errorString);
}