QRemoteObjectReplica¶
A class interacting with (but not implementing) a Qt API on the Remote Object network. More…
Inherited by: QRemoteObjectRegistry, QRemoteObjectDynamicReplica
Synopsis¶
Functions¶
def
initializeNode
(node[, name=””])def
isInitialized
()def
isReplicaValid
()def
node
()def
persistProperties
(repName, repSig, props)def
propAsVariant
(i)def
retrieveProperties
(repName, repSig)def
send
(call, index, args)def
sendWithReply
(call, index, args)def
setChild
(i, arg__2)def
state
()def
waitForSource
([timeout=30000])
Virtual functions¶
def
initialize
()def
setNode
(node)
Signals¶
def
initialized
()def
notified
()def
stateChanged
(state, oldState)
Detailed Description¶
A Remote Object Replica is a QObject
proxy for another QObject
(called the Source object). Once initialized, a replica can be considered a “latent copy” of the Source object. That is, every change to a Q_PROPERTY
on the Source , or signal emitted by the Source will be updated/emitted by all Replica objects. Latency is introduced by process scheduling by any OSes involved and network communication latency. As long as the replica has been initialized and the communication is not disrupted, receipt and order of changes is guaranteed.
The isInitialized
and state
properties (and corresponding initialized()
/ stateChanged()
signals) allow the state of a Replica to be determined.
While Qt Remote Objects (QtRO) handles the initialization and synchronization of Replica objects, there are numerous steps happening behind the scenes which can fail and that aren’t encountered in single process Qt applications. See Troubleshooting for advice on how to handle such issues when using a remote objects network.
- class PySide6.QtRemoteObjects.QRemoteObjectReplica¶
- PySide6.QtRemoteObjects.QRemoteObjectReplica.State¶
This enum type specifies the various state codes associated with QRemoteObjectReplica
states:
Constant
Description
QRemoteObjectReplica.Uninitialized
Initial value of DynamicReplica, where nothing is known about the replica before connection to source.
QRemoteObjectReplica.Default
Initial value of static replica, where any defaults set in the .rep file are available so it can be used if necessary.
QRemoteObjectReplica.Valid
Indicates the replica is connected, has good property values and can be interacted with.
QRemoteObjectReplica.Suspect
Error state that occurs if the connection to the source is lost after it is initialized.
QRemoteObjectReplica.SignatureMismatch
Error state that occurs if a connection to the source is made, but the source and replica are not derived from the same .rep (only possible for static Replicas).
- PySide6.QtRemoteObjects.QRemoteObjectReplica.initialize()¶
- PySide6.QtRemoteObjects.QRemoteObjectReplica.initializeNode(node[, name=""])¶
- Parameters
name – str
- PySide6.QtRemoteObjects.QRemoteObjectReplica.initialized()¶
- PySide6.QtRemoteObjects.QRemoteObjectReplica.isInitialized()¶
- Return type
bool
Returns true
if this replica has been initialized with data from the Source object. Returns false
otherwise.
See also
- PySide6.QtRemoteObjects.QRemoteObjectReplica.isReplicaValid()¶
- Return type
bool
Returns true
if this replica has been initialized and has a valid connection with the node
hosting the Source . Returns false
otherwise.
See also
- PySide6.QtRemoteObjects.QRemoteObjectReplica.node()¶
- Return type
This property holds A pointer to the node this object was acquired from..
- PySide6.QtRemoteObjects.QRemoteObjectReplica.notified()¶
- PySide6.QtRemoteObjects.QRemoteObjectReplica.persistProperties(repName, repSig, props)¶
- Parameters
repName – str
repSig –
PySide6.QtCore.QByteArray
props –
- PySide6.QtRemoteObjects.QRemoteObjectReplica.propAsVariant(i)¶
- Parameters
i – int
- Return type
object
- PySide6.QtRemoteObjects.QRemoteObjectReplica.retrieveProperties(repName, repSig)¶
- Parameters
repName – str
repSig –
PySide6.QtCore.QByteArray
- Return type
- PySide6.QtRemoteObjects.QRemoteObjectReplica.send(call, index, args)¶
- Parameters
call –
Call
index – int
args –
- PySide6.QtRemoteObjects.QRemoteObjectReplica.sendWithReply(call, index, args)¶
- Parameters
call –
Call
index – int
args –
- Return type
- PySide6.QtRemoteObjects.QRemoteObjectReplica.setChild(i, arg__2)¶
- Parameters
i – int
arg__2 – object
- PySide6.QtRemoteObjects.QRemoteObjectReplica.setNode(node)¶
- Parameters
This property holds A pointer to the node this object was acquired from..
This property holds Returns the replica state..
This property holds the replica State
.
- PySide6.QtRemoteObjects.QRemoteObjectReplica.stateChanged(state, oldState)¶
- PySide6.QtRemoteObjects.QRemoteObjectReplica.waitForSource([timeout=30000])¶
- Parameters
timeout – int
- Return type
bool
Blocking call that waits for the replica to become initialized or until the timeout
(in ms) expires. Returns true
if the replica is initialized when the call completes, false
otherwise.
If timeout
is -1, this function will not time out.
See also
© 2022 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.