QtROServerFactory Class

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

头文件: #include <QtROServerFactory>
qmake: QT += remoteobjects

公有函数

QtROServerFactory()
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

成员函数

QtROServerFactory::QtROServerFactory()

Default constructs an instance of QtROServerFactory.

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

void QtROServerFactory::registerType(const QString &id)

相关非成员

void qRegisterRemoteObjectsServer(const QString &id)

Registers the Remote Objects server id for the type T.

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

Note: This function requires that T is a fully defined type at the point where the function is called.

This example registers the class 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.