QtROServerFactory 类

保持 Qt Remote Objects 网络可用服务器后端有关信息的类。 更多...

头: #include <QtROServerFactory>
qmake: QT += remoteobjects
    void qRegisterRemoteObjectsServer (const QString & id )

    详细描述

    相关非成员

    template <typename T> void qRegisterRemoteObjectsServer (const QString & id )

    注册远程对象服务器 id 为类型 T .

    若 Qt Remote Objects 需要自定义传输协议,需要在这里注册客户端和服务器实现。

    注意: 此函数要求 T 是完全定义的类型, 在函数被调用时。

    此范例注册类 CustomServerImpl as "myprotocol" :

    qRegisterRemoteObjectsServer<CustomServerImpl>(QStringLiteral("myprotocol"));
    					

    原位采用这,现在可以使用这种新的自定义协议实例化节点:

    QRemoteObjectNode client(QUrl(QStringLiteral("myprotocol:registry")));
    					

    另请参阅 qRegisterRemoteObjectsServer.