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.