QtROServerFactory Class
一个类,用于存储Qt Remote Objects 网络中可用服务器后端的相关信息。更多内容...
| 头文件: | #include <QtROServerFactory> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS RemoteObjects) target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects) |
| qmake: | QT += remoteobjects |
相关非会员
| void | qRegisterRemoteObjectsServer(const QString &id) |
相关非会员
template <typename T> void qRegisterRemoteObjectsServer(const QString &id)
为类型T 注册远程对象服务器id 。
如果需要为Qt Remote Objects 使用自定义传输协议,则需在此处注册客户端和服务器实现。
注意:此 函数要求在调用该函数时,T 必须是一个完全定义的类型。
此示例将类CustomServerImpl 注册为"myprotocol" :
qRegisterRemoteObjectsServer<CustomServerImpl>(QStringLiteral("myprotocol"));完成上述设置后,您现在可以使用此新的自定义协议来实例化节点:
QRemoteObjectNode client(QUrl(QStringLiteral("myprotocol:registry")));另请参阅 qRegisterRemoteObjectsClient 。
© 2026 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.