IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QRemoteObjectDynamicReplica Class

A dynamically instantiated Replica.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QRemoteObjectDynamicReplica Class

  • Header: QRemoteObjectDynamicReplica

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)

    target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects)

  • qmake: QT += remoteobjects

  • Inherits: QRemoteObjectReplica

Detailed Description

There are generated replicas (replicas having the header files produced by the Replica Compiler), and dynamic replicas, that are generated on-the-fly. This is the class for the dynamic type of replica.

When the connection to the Source object is made, the initialization step passes the current property values (see Replica Initialization). In a DynamicReplica, the property/signal/slot details are also sent, allowing the replica object to be created on-the-fly. This can be convenient in QML or scripting, but has two primary disadvantages. First, the object is in effect "empty" until it is successfully initialized by the Source. Second, in C++, calls must be made using QMetaObject::invokeMethod(), as the moc generated lookup will not be available.

This class does not have a public constructor. It can only be instantiated by using the dynamic QRemoteObjectNode::acquire method.

Member Function Documentation

 

[override virtual] QRemoteObjectDynamicReplica::~QRemoteObjectDynamicReplica()

Destroys the dynamic replica.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+