Host QML Type
Qt Remote Objects 网络上的主机节点。更多
Import Statement: | import QtRemoteObjects 6.9 |
In C++: | QRemoteObjectHost |
属性
- hostUrl : url
方法
- bool disableRemoting(object remoteObject)
- bool enableRemoting(object object, string name)
详细说明
Host 类型为Qt Remote Objects 网络提供了一个入口。网络可以是简单的两个节点,也可以是任意复杂的进程和设备。
主机具有与节点相同的功能,但它们也可以连接到网络上的源对象并共享源对象。
属性文档
hostUrl : url |
节点的主机地址。
这是该节点远程传输源对象的地址。
方法文档
bool disableRemoting(object remoteObject) |
禁用QObject remoteObject 的远程访问。如果当前节点是客户端节点或remoteObject 未注册,则返回false
;如果源对象的远程访问已成功禁用,则返回true
。
警告: 调用此方法后,此对象的副本将不再有效。
另请参阅 enableRemoting().
bool enableRemoting(object object, string name) |
使主机节点能够动态提供对QObject object 的远程访问。连接到托管此对象的节点的客户端节点可获取此源的副本。
可选的name 定义了可通过QRemoteObjectNode::acquire() 获取QObject 的查找名称。如果未明确设置,则将使用 QCLASSINFO_REMOTEOBJECT_TYPE 中给出的名称。如果没有为QObject 定义此类宏,则使用QObject::objectName() 。
如果当前节点是客户端节点,或QObject 已注册要进行远程操作,则返回false
;如果动态QObject 已成功启用远程操作,则返回true
。
另请参阅 disableRemoting()。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.