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.