Changes to Qt WebSockets

Qt 6 是努力使框架更高效,且更易于使用的结果。

为兼容每个发行的所有公共 API,我们试着维护二进制和源代码。但是,为使 Qt 成为更优框架,一些改变是不可避免的。

In this topic we summarize those changes in Qt WebSockets, and provide guidance to handle them.

Breaking public API changes

This section contains information about API changes that break source compatibility.

QWebSocketServer::socketDescriptor(), QWebSocketServer::setSocketDescriptor()

In Qt 6, you should use QWebSocketServer::socketDescriptor () 和 QWebSocketServer::setSocketDescriptor () to access the underlying socket descriptor of type qintptr . They mirror QTcpServer::socketDescriptor () 和 QTcpServer::setSocketDescriptor (), and replace the now deprecated nativeDescriptor() and setNativeDescriptor() methods.