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")));
另请参阅 qRegisterRemoteObjectsServer。
© 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.