QtROServerFactory 類

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)
void registerType (const QString & id )
void qRegisterRemoteObjectsServer (const QString & id )

詳細描述

A class holding information about server backends available on the Qt Remote Objects network

成員函數文檔編製

QConnectionAbstractServer *QtROServerFactory:: create (const QUrl & url , QObject * parent = nullptr)

void QtROServerFactory:: registerType (const QString & id )

相關非成員

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.