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)
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.

成员函数文档编制

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

[static] QtROServerFactory *QtROServerFactory:: instance ()

bool QtROServerFactory:: isValid (const QUrl & url )

void QtROServerFactory:: registerType (const QString & id )

相关非成员

void qRegisterRemoteObjectsServer (const QString & id )

Registers the Remote Objects server id 为类型 T .

If you need a custom transport protocol for Qt Remote Objects, you need to register the client & server implementation here.

注意: 此函数要求 T is a fully defined type at the point where the function is called.

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

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

With this in place, you can now instantiate nodes using this new custom protocol:

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

另请参阅 qRegisterRemoteObjectsServer.