From f0976bb685584beb710e7512f661ab0d48f8f983 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 20 Aug 2021 14:58:04 +0200 Subject: Update changes doc with the singular change Only the removal of the deprecated API. Fixes: QTBUG-94932 Change-Id: Ib7de6b11701d4f39273eb33e75e1cc8fe2deeae3 Reviewed-by: Alex Blasche (cherry picked from commit f9cd291d9713fa67969a6f20738efdc624a2c0c5) Reviewed-by: Qt Cherry-pick Bot --- src/websockets/doc/src/qt6-changes.qdoc | 12 ++++++++++++ src/websockets/qwebsocketserver.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/websockets/doc/src/qt6-changes.qdoc b/src/websockets/doc/src/qt6-changes.qdoc index 84e0e68..fe4a338 100644 --- a/src/websockets/doc/src/qt6-changes.qdoc +++ b/src/websockets/doc/src/qt6-changes.qdoc @@ -41,4 +41,16 @@ In this topic we summarize those changes in Qt WebSockets, and provide guidance to handle them. + \section1 Breaking public API changes + + This section contains information about API changes that break source + compatibility. + + \section2 QWebSocketServer::socketDescriptor(), QWebSocketServer::setSocketDescriptor() + + In Qt 6, you should use QWebSocketServer::socketDescriptor() and QWebSocketServer::setSocketDescriptor() + to access the underlying socket descriptor of type \c{qintptr}. They mirror QTcpServer::socketDescriptor() + and QTcpServer::setSocketDescriptor(), and replace the now deprecated nativeDescriptor() and + setNativeDescriptor() methods. + */ diff --git a/src/websockets/qwebsocketserver.cpp b/src/websockets/qwebsocketserver.cpp index 6f590ad..989812f 100644 --- a/src/websockets/qwebsocketserver.cpp +++ b/src/websockets/qwebsocketserver.cpp @@ -696,6 +696,35 @@ qintptr QWebSocketServer::socketDescriptor() const return d->socketDescriptor(); } +#if QT_DEPRECATED_SINCE(6, 2) +/*! + \fn bool QWebSocketServer::setNativeDescriptor(qintptr socketDescriptor) + + \deprecated + Sets the socket descriptor this server should use when listening for incoming connections to + \a socketDescriptor. + + Returns true if the socket is set successfully; otherwise returns false. + The socket is assumed to be in listening state. + + \sa nativeDescriptor(), setSocketDescriptor(), isListening() + \since 5.12 + */ + +/*! + \fn qintptr QWebSocketServer::nativeDescriptor() const + + \deprecated + Returns the native socket descriptor the server uses to listen for incoming instructions, + or -1 if the server is not listening. + If the server is using QNetworkProxy, the returned descriptor may not be usable with + native socket functions. + + \sa setNativeDescriptor(), socketDescriptor(), isListening() + \since 5.12 + */ +#endif + /*! Returns a list of WebSocket versions that this server is supporting. */ -- cgit v1.2.1