QRemoteObjectNode#
A node on a Qt Remote Objects network. More…
Inherited by: QRemoteObjectHostBase, QRemoteObjectRegistryHost, QRemoteObjectHost
Synopsis#
Properties#
heartbeatInterval
- Heartbeat interval in mspersistedStore
- Allows setting a QRemoteObjectAbstractPersistedStore instance for the noderegistryUrl
- Address of the Registry used by this node
Functions#
def
acquireDynamic
(name)def
acquireModel
(name)def
addClientSideConnection
(ioDevice)def
connectToNode
(address)def
heartbeatInterval
()def
instances
(typeName)def
lastError
()def
persistedStore
()def
registry
()def
registryUrl
()def
setHeartbeatInterval
(interval)def
setPersistedStore
(persistedStore)def
waitForRegistry
([timeout=30000])
Virtual functions#
def
setName
(name)def
setRegistryUrl
(registryAddress)
Signals#
def
error
(errorCode)def
heartbeatIntervalChanged
(heartbeatInterval)def
remoteObjectAdded
(arg__1)def
remoteObjectRemoved
(arg__1)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
The QRemoteObjectNode
class provides an entry point to a QtRemoteObjects network. A network can be as simple as two nodes, or an arbitrarily complex set of processes and devices.
A QRemoteObjectNode
does not have a url that other nodes can connect to, and thus is able to acquire replicas only. It is not able to share source objects (only QRemoteObjectHost
and QRemoteObjectRegistryHost
Nodes can share).
Nodes may connect to each other directly using connectToNode
, or they can use the QRemoteObjectRegistry
to simplify connections.
The QRemoteObjectRegistry
is a special replica available to every node that connects to the Registry Url. It knows how to connect to every QRemoteObjectSource object on the network.
- class PySide6.QtRemoteObjects.QRemoteObjectNode([parent=None])#
PySide6.QtRemoteObjects.QRemoteObjectNode(registryAddress[, parent=None])
- Parameters:
registryAddress –
PySide6.QtCore.QUrl
parent –
PySide6.QtCore.QObject
Default constructor for QRemoteObjectNode
with the given parent
. A Node constructed in this manner can not be connected to, and thus can not expose Source objects on the network. It also will not include a QRemoteObjectRegistry
, unless set manually using setRegistryUrl
.
See also
QRemoteObjectNode
connected to a { QRemoteObjectRegistry
} {Registry}. A Node constructed in this manner can not be connected to, and thus can not expose Source objects on the network. Finding and connecting to other (Host) Nodes is handled by the QRemoteObjectRegistry
specified by registryAddress
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtRemoteObjects.QRemoteObjectNode.heartbeatInterval: int#
This property holds Heartbeat interval in ms..
The heartbeat (only helpful for socket connections) will periodically send a message to connected nodes to detect whether the connection was disrupted. Qt Remote Objects will try to reconnect automatically if it detects a dropped connection. This function can help with that detection since the client will only detect that the server is unavailable when it tries to send data.
A value of 0
(the default) will disable the heartbeat.
- Access functions:
setHeartbeatInterval
(interval)Signal
heartbeatIntervalChanged
(heartbeatInterval)
- property PᅟySide6.QtRemoteObjects.QRemoteObjectNode.persistedStore: PySide6.QtRemoteObjects.QRemoteObjectAbstractPersistedStore#
This property holds Allows setting a QRemoteObjectAbstractPersistedStore
instance for the node..
Allows replica PROP members with the PERSISTED trait to save their current value when the replica is deleted and restore a stored value the next time the replica is started.
Requires a QRemoteObjectAbstractPersistedStore
class implementation to control where and how persistence is handled.
- Access functions:
setPersistedStore
(persistedStore)
- property PᅟySide6.QtRemoteObjects.QRemoteObjectNode.registryUrl: PySide6.QtCore.QUrl#
This property holds The address of the Registry
used by this node..
This is an empty QUrl
if there is no registry in use.
- Access functions:
registryUrl
()setRegistryUrl
(registryAddress)
- PySide6.QtRemoteObjects.QRemoteObjectNode.ErrorCode#
This enum type specifies the various error codes associated with QRemoteObjectNode
errors:
Constant
Description
QRemoteObjectNode.NoError
No error.
QRemoteObjectNode.RegistryNotAcquired
The registry could not be acquired.
QRemoteObjectNode.RegistryAlreadyHosted
The registry is already defined and hosting Sources.
QRemoteObjectNode.NodeIsNoServer
The given
QRemoteObjectNode
is not a host node.QRemoteObjectNode.ServerAlreadyCreated
The host node has already been initialized.
QRemoteObjectNode.UnintendedRegistryHosting
An attempt was made to create a host
QRemoteObjectNode
and connect to itself as the registry.QRemoteObjectNode.OperationNotValidOnClientNode
The attempted operation is not valid on a client
QRemoteObjectNode
.QRemoteObjectNode.SourceNotRegistered
The given QRemoteObjectSource is not registered on this node.
QRemoteObjectNode.MissingObjectName
The given
QObject
does not haveobjectName()
set.QRemoteObjectNode.HostUrlInvalid
The given url has an invalid or unrecognized scheme.
QRemoteObjectNode.ProtocolMismatch
The client and the server have different protocol versions.
QRemoteObjectNode.ListenFailed
Can’t listen on the specified host port.
- PySide6.QtRemoteObjects.QRemoteObjectNode.acquireDynamic(name)#
- Parameters:
name – str
- Return type:
Returns a QRemoteObjectDynamicReplica
of the Source name
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.acquireModel(name)#
- Parameters:
name – str
- Return type:
- PySide6.QtRemoteObjects.QRemoteObjectNode.addClientSideConnection(ioDevice)#
- Parameters:
ioDevice –
PySide6.QtCore.QIODevice
In order to acquire()
Replica objects over External QIODevices , Qt Remote Objects needs access to the communications channel (a QIODevice
) between the respective nodes. It is the addClientSideConnection() call that enables this, taking the ioDevice
as input. Any acquire()
call made without calling addClientSideConnection will still work, but the Node will not be able to initialize the Replica without being provided the connection to the Host node.
See also
- PySide6.QtRemoteObjects.QRemoteObjectNode.connectToNode(address)#
- Parameters:
address –
PySide6.QtCore.QUrl
- Return type:
bool
Connects a client node to the host node at address
.
Connections will remain valid until the host node is deleted or no longer accessible over a network.
Once a client is connected to a host, valid Replicas can then be acquired if the corresponding Source is being remoted.
Return true
on success, false
otherwise (usually an unrecognized url, or connecting to already connected address).
- PySide6.QtRemoteObjects.QRemoteObjectNode.heartbeatInterval()#
- Return type:
int
See also
Getter of property heartbeatInterval
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.heartbeatIntervalChanged(heartbeatInterval)#
- Parameters:
heartbeatInterval – int
Notification signal of property heartbeatInterval
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.instances(typeName)#
- Parameters:
typeName –
QStringView
- Return type:
list of strings
This function overloads instances()
.
This convenience function provides the same result as the templated version, but takes the name of the Source class as a parameter (typeName
) rather than deriving it from the class type.
Returns the last error set.
- PySide6.QtRemoteObjects.QRemoteObjectNode.persistedStore()#
-
See also
Getter of property persistedStore
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.registry()#
- Return type:
Returns a pointer to the Node’s QRemoteObjectRegistry
, if the Node is using the Registry feature; otherwise it returns None
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.registryUrl()#
- Return type:
See also
Getter of property registryUrl
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.remoteObjectAdded(arg__1)#
- Parameters:
arg__1 –
This signal is emitted whenever a new Source object is added to the Registry. The signal will not be emitted if there is no Registry set (i.e., Sources over connections made via connectToNode
directly). The loc
parameter contains the information about the added Source, including name, type and the QUrl
of the hosting Node.
See also
- PySide6.QtRemoteObjects.QRemoteObjectNode.remoteObjectRemoved(arg__1)#
- Parameters:
arg__1 –
This signal is emitted whenever a known Source object is removed from the Registry. The signal will not be emitted if there is no Registry set (i.e., Sources over connections made via connectToNode
directly). The loc
parameter contains the information about the removed Source, including name, type and the QUrl
of the hosting Node.
See also
- PySide6.QtRemoteObjects.QRemoteObjectNode.setHeartbeatInterval(interval)#
- Parameters:
interval – int
See also
Setter of property heartbeatInterval
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.setName(name)#
- Parameters:
name – str
Sets name
as the internal name for this Node. This is then output as part of the logging (if enabled). This is primarily useful if you merge log data from multiple nodes.
- PySide6.QtRemoteObjects.QRemoteObjectNode.setPersistedStore(persistedStore)#
- Parameters:
persistedStore –
PySide6.QtRemoteObjects.QRemoteObjectAbstractPersistedStore
See also
Setter of property persistedStore
.
- PySide6.QtRemoteObjects.QRemoteObjectNode.setRegistryUrl(registryAddress)#
- Parameters:
registryAddress –
PySide6.QtCore.QUrl
- Return type:
bool
See also
- PySide6.QtRemoteObjects.QRemoteObjectNode.waitForRegistry([timeout=30000])#
- Parameters:
timeout – int
- Return type:
bool
Blocks until this Node’s Registry is initialized or timeout
(in milliseconds) expires. Returns true
if the Registry is successfully initialized upon return, or false
otherwise.