QRemoteObjectHost 类

Qt Remote Objects 网络 (主机) 节点。 更多...

头: #include <QRemoteObjectHost>
qmake: QT += remoteobjects
继承: QRemoteObjectHostBase

公共函数

QRemoteObjectHost (QObject * parent = nullptr)
QRemoteObjectHost (const QUrl & address , const QUrl & registryAddress = QUrl(), QObject * parent = nullptr)
QRemoteObjectHost (const QUrl & address , QObject * parent )
virtual ~QRemoteObjectHost ()

重实现公共函数

virtual QUrl hostUrl () const override
virtual bool setHostUrl (const QUrl & hostAddress ) override

额外继承成员

详细描述

Qt Remote Objects 网络 (主机) 节点。

QRemoteObjectHost class provides an entry point to a QtRemoteObjects 网络。网络可以简单到 2 节点,或任意复杂的一组进程和设备。

QRemoteObjectHosts 拥有如 QRemoteObjectNodes 的相同能力,但它们还可以连接到网络源对象并共享网络源对象。

节点可以相互直接连接使用 connectToNode ,或者它们可以使用 QRemoteObjectRegistry 以简化连接。

QRemoteObjectRegistry is a special replica available to every node that connects to the uegistry Url. It knows how to connect to every QRemoteObjectSource object on the network.

另请参阅 QRemoteObjectNode and QRemoteObjectRegistryHost .

成员函数文档编制

QRemoteObjectHost:: QRemoteObjectHost ( QObject * parent = nullptr)

构造新的 QRemoteObjectHost Node (i.e., a Node that supports exposing 对象在 QtRO 网络) 采用给定 parent . This constructor is meant specific to support QML in the future as it will not be available to connect to until setHostUrl () 被调用。

另请参阅 setHostUrl () 和 setRegistryUrl ().

QRemoteObjectHost:: QRemoteObjectHost (const QUrl & address , const QUrl & registryAddress = QUrl(), QObject * parent = nullptr)

构造新的 QRemoteObjectHost Node (i.e., a Node that supports exposing 对象在 QtRO 网络) 采用地址 address 。若设置, registryAddress 将用于连接到 QRemoteObjectRegistry at the provided address.

另请参阅 setHostUrl () 和 setRegistryUrl ().

QRemoteObjectHost:: QRemoteObjectHost (const QUrl & address , QObject * parent )

构造新的 QRemoteObjectHost Node (i.e., a Node that supports exposing 对象在 QtRO 网络) 采用 URL address 和给定 parent 。提供此重载是为方便指定 QObject 父级不用提供注册地址。

另请参阅 setHostUrl () 和 setRegistryUrl ().

[virtual] QRemoteObjectHost:: ~QRemoteObjectHost ()

Destroys the instance of QRemoteObjectHost. The destructor is virtual.

[override virtual] QUrl QRemoteObjectHost:: hostUrl () const

返回主机地址为 QRemoteObjectNode 作为 QUrl . If the Node is not a Host node, it return an empty QUrl .

另请参阅 setHostUrl ().

[override virtual] bool QRemoteObjectHost:: setHostUrl (const QUrl & hostAddress )

设置 hostAddress 为主机 QRemoteObjectNode .

返回 true 若有设置 Host (主机) 地址,否则 false .

另请参阅 hostUrl ().