vcpkg/ports/qcoro/0001-qt6-deprecated-qwebsocket-error.patch
2023-10-09 16:21:05 -07:00

20 lines
873 B
Diff

diff --git a/qcoro/websockets/qcorowebsocket.cpp b/qcoro/websockets/qcorowebsocket.cpp
index be9c1f7..c686d14 100644
--- a/qcoro/websockets/qcorowebsocket.cpp
+++ b/qcoro/websockets/qcorowebsocket.cpp
@@ -32,7 +32,13 @@ public:
emitReady(true);
}
}))
- , mError(connect(socket, qOverload<QAbstractSocket::SocketError>(&QWebSocket::error), this, [this](auto error) {
+ , mError(connect(socket, qOverload<QAbstractSocket::SocketError>(
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ &QWebSocket::errorOccurred
+#else
+ &QWebSocket::error
+#endif
+ ), this, [this](auto error) {
qWarning() << "QWebSocket failed to connect to a websocket server: " << error;
emitReady(false);
}))