QRemoteObjectHost 类

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

头: #include <QRemoteObjectHost>
qmake: QT += remoteobjects
实例化: Host
继承: QRemoteObjectHostBase

特性

公共函数

QRemoteObjectHost (const QUrl & address , QObject * parent )
QRemoteObjectHost (const QUrl & address , const QUrl & registryAddress = QUrl(), QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly, QObject * parent = nullptr)
QRemoteObjectHost (QObject * parent = nullptr)

重实现公共函数

virtual QUrl hostUrl () const override
virtual bool setHostUrl (const QUrl & hostAddress , QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly) override

信号

void hostUrlChanged ()

详细描述

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

特性文档编制

hostUrl : QUrl

This property holds the host address for the node.

This is the address where source objects remoted by this node will reside.

访问函数:

virtual QUrl hostUrl () const override
virtual bool setHostUrl (const QUrl & hostAddress , QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly) override

通知程序信号:

void hostUrlChanged ()

成员函数文档编制

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

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

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

QRemoteObjectHost:: QRemoteObjectHost (const QUrl & address , const QUrl & registryAddress = QUrl(), QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly, QObject * parent = nullptr)

Constructs a new QRemoteObjectHost Node (i.e., a Node that supports exposing 对象在 QtRO 网络) 采用地址 address 。若设置, registryAddress 将用于连接到 QRemoteObjectRegistry at the provided address. The allowedSchemas parameter is only needed (and should be set to AllowExternalRegistration ) if the schema of the url should be used as an External Schema by the registry.

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

QRemoteObjectHost:: QRemoteObjectHost ( QObject * parent = nullptr)

Constructs a new 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 ().

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

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

注意: Getter function for property hostUrl.

另请参阅 setHostUrl ().

[override virtual] bool QRemoteObjectHost:: setHostUrl (const QUrl & hostAddress , QRemoteObjectHostBase::AllowedSchemas allowedSchemas = BuiltInSchemasOnly)

设置 hostAddress 为主机 QRemoteObjectNode .

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

allowedSchemas parameter is only needed (and should be set to AllowExternalRegistration ) if the schema of the url should be used as an External Schema by the registry.

注意: Setter 函数对于特性 hostUrl .

另请参阅 hostUrl ().