Host QML Type
Qt Remote Objects 网络上的主机节点。更多...
| Import Statement: | import QtRemoteObjects 6.12 |
| In C++: | QRemoteObjectHost |
属性
- hostUrl : url
方法
- bool disableRemoting(object remoteObject)
- bool enableRemoting(object object, string name)
详细说明
“主机”类型为Qt Remote Objects 网络提供了一个入口点。一个网络可以简单到仅包含两个节点,也可以是任意复杂的进程和设备集合。
主机具备与节点相同的功能,但还可以连接到网络,并在网络上共享源对象。
属性文档
hostUrl : url
该节点的主机地址。
这是由该节点远程传输的源对象所驻留的地址。
方法文档
bool disableRemoting(object remoteObject)
禁用QObject 的远程访问remoteObject 。如果当前节点是客户端节点,或者remoteObject 未注册,则返回false ;如果成功禁用了Source对象的远程访问,则返回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()。
© 2026 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.