A class holding information about server backends available on the Qt Remote Objects network. 更多...
| 头: | #include <QtROServerFactory> |
| qmake: | QT += remoteobjects |
| QConnectionAbstractServer * | create (const QUrl & url , QObject * parent = nullptr) |
| bool | isValid (const QUrl & url ) |
| void | registerType (const QString & id ) |
| QtROServerFactory * | instance () |
| void | qRegisterRemoteObjectsServer (const QString & id ) |
A class holding information about server backends available on the Qt Remote Objects network.
[static]
QtROServerFactory
*QtROServerFactory::
instance
()
注册远程对象服务器
id
为类型
T
.
若 Qt Remote Objects 需要自定义传输协议,需要在这里注册客户端和服务器实现。
注意:
此函数要求
T
是完全定义的类型, 在函数被调用时。
此范例注册类
CustomServerImpl
as
"myprotocol"
:
qRegisterRemoteObjectsServer<CustomServerImpl>(QStringLiteral("myprotocol"));
原位采用这,现在可以使用这种新的自定义协议实例化节点:
QRemoteObjectNode client(QUrl(QStringLiteral("myprotocol:registry")));
另请参阅 qRegisterRemoteObjectsServer.