QRemoteObjectDynamicReplica Class
头文件: | #include <QRemoteObjectDynamicReplica> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS RemoteObjects) target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects) |
qmake: | QT += remoteobjects |
继承: | QRemoteObjectReplica |
公共函数
virtual | ~QRemoteObjectDynamicReplica() override |
详细说明
副本有生成的副本(拥有由副本编译器生成的头文件的副本)和动态副本,后者是即时生成的。该类用于动态类型的副本。
在与源对象建立连接时,初始化步骤会传递当前的属性值(请参阅复制初始化)。在 DynamicReplica 中,属性/信号/插槽细节也会被发送,从而允许复制对象被即时创建。这在 QML 或脚本中很方便,但有两个主要缺点。首先,在源成功初始化之前,对象实际上是 "空 "的。其次,在 C++ 中,必须使用QMetaObject::invokeMethod() 进行调用,因为 moc 生成的查找将不可用。
该类没有公共构造函数。它只能通过动态QRemoteObjectNode::acquire 方法实例化。
成员函数文档
[override virtual noexcept]
QRemoteObjectDynamicReplica::~QRemoteObjectDynamicReplica()
销毁动态副本。
另请参阅 " 副本所有权"。
© 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.