QtROClientFactory 類

A class holding information about client backends available on the Qt Remote Objects network. 更多...

頭: #include <QtROClientFactory>
qmake: QT += remoteobjects

公共函數

ClientIoDevice * create (const QUrl & url , QObject * parent = nullptr)
bool isValid (const QUrl & url )
void registerType (const QString & id )

靜態公共成員

QtROClientFactory * instance ()
void qRegisterRemoteObjectsClient (const QString & id )

詳細描述

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

成員函數文檔編製

ClientIoDevice *QtROClientFactory:: create (const QUrl & url , QObject * parent = nullptr)

[static] QtROClientFactory *QtROClientFactory:: instance ()

bool QtROClientFactory:: isValid (const QUrl & url )

void QtROClientFactory:: registerType (const QString & id )

相關非成員

void qRegisterRemoteObjectsClient (const QString & id )

注冊遠程對象客戶端 id 為類型 T .

若 Qt Remote Objects 需要自定義傳輸協議,需要在這裏注冊客戶端和服務器實現。

注意: 此函數要求 T 是完全定義的類型, 在函數被調用時。

此範例注冊類 CustomClientIo as "myprotocol" :

qRegisterRemoteObjectsClient<CustomClientIo>(QStringLiteral("myprotocol"));
					

原位采用這,現在可以使用這種新的自定義協議實例化節點:

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

另請參閱 qRegisterRemoteObjectsServer .