- Qt 6.10
- Qt WebSockets
- C++ Classes
- QWebSocket
- Qt 6.10.0 Reference Documentation

# Obsolete Members for QWebSocket

The following members of class QWebSocket are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Signals

`(deprecated in 6.5)` void | error(QAbstractSocket::SocketError error)

## Member Function Documentation

### `[signal, deprecated in 6.5]` void QWebSocket::error(QAbstractSocket::SocketError error)

This function is deprecated since 6.5. We strongly advise against using it in new code.

Use errorOccurred(QAbstractSocket::SocketError error) instead.

Note: This signal is overloaded. To connect to this signal:

     // Connect using qOverload:
     connect(webSocket, qOverload(&QWebSocket::error),
             receiver, &ReceiverClass::slot);

     // Or using a lambda:
     connect(webSocket, qOverload(&QWebSocket::error),
             this, [](QAbstractSocket::SocketError error) { /* handle error */ });

For more examples and approaches, see connecting to overloaded signals.