Qt WebSockets

Qt 6 是我们努力使框架更高效、更易用的结果。

我们努力在每个版本中保持所有公共 API 的二进制和源代码兼容性。但为了使 Qt 成为更好的框架,有些改动是不可避免的。

在本专题中,我们总结了Qt WebSockets 中的这些更改,并提供了处理这些更改的指导。

破坏公共 API 的更改

本节包含有关破坏源代码兼容性的 API 变动的信息。

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

在 Qt XML 6 中,应使用QWebSocketServer::socketDescriptor() 和QWebSocketServer::setSocketDescriptor() 访问qintptr 类型的底层套接字描述符。它们是QTcpServer::socketDescriptor() 和QTcpServer::setSocketDescriptor() 的镜像,取代了现已废弃的 nativeDescriptor() 和 setNativeDescriptor() 方法。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.