Qt Remote Objects 注册表

注册表提供了一种更简便的方式来建立这些连接。 每个希望加入注册表网络的节点都会连接到注册表。注册表本身是一个专门的源对象,因此由一个节点托管。连接到注册表只需将注册表的 URL 传递给QRemoteObjectNode 或QRemoteObjectHost 的构造函数,或者将 URL 传递给 setRegistryUrl 方法即可。

注册表与 QtRO 紧密集成。每当添加或移除一个源(Source)时,注册表中的名称/URL 都会自动更新。因此,一旦您的节点连接到注册表,就无需手动连接到任何其他节点。 如果您在网络上请求某个对象,但尚未连接到托管该对象的节点,注册表将知道应连接到哪个 URL 并主动建立连接。一旦连接成功(且可用的对象列表被传递过来,包括所需的Source),所请求的Replica的初始化过程将自动启动。

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