Qt Remote Objects 5.9

Qt 5.9 | Qt Remote Objects

Qt 5.9.3 Reference Documentation

# Qt Remote Objects

## Remote Object Concepts

Qt Remote Objects (QtRO) is an inter-process communication (IPC) module developed for Qt. The idea is to extend existing Qt's functionalities to enable an easy exchange of information between processes or computers.

One of the key features of Qt to enable this is the distinction between an objects API (defined by its Q_Property, Signals and Slots) and the implementation of that API. The purpose of QtRO is to meet the expected API, even if the true QObject is in a different process. A Slot called on a copy of an object (called a Replica in QtRO) is forwarded to the true object (called a Source in QtRO) for handling. Updates to the Source (either property changes or emitted Signals) are forwarded to every Replica.

A Replica is a light-weight proxy for the Source object, but one that supports the same connections and behavior of QObjects, which makes them as easy to use as any other QObject provided by Qt. Everything needed for the Replica to look like the Source object is handled behind the scenes by QtRO.

Note that Remote Objects behave differently from traditional remote procedure call (RPC) implementations. In RPC, the client makes a request and waits for the response. In RPC, the server does not push anything to the client unless it is in response to a request. The design of RPC is often such that different clients are independent of each other (for instance, two clients can ask a mapping service for directions and get different results). While it is possible to implement this in QtRO (as Source without properties, and Slots that have return values), it is designed more to hide the fact that the processing is really remote. You let a node give you the Replica instead of creating it yourself, possibly use the status signals (isReplicaValid()), but then interact with the object like you would with any other QObject-based type.

## Related Information

### Getting Started

To enable Qt Remote Objects in a project, add this directive into the C++ files:

      #include <QtRemoteObjects>

To link against the Qt Remote Objects module, add this line to the project file:

      QT += remoteobjects

### Guides

- Overview Qt Remote Objects
- Qt Remote Objects C++ Classes
- Qt Remote Objects Nodes
- Qt Remote Objects Source Objects
- Qt Remote Objects Replica Objects
- Qt Remote Objects Registry
- Qt Remote Objects Compiler
- Remote Object Interaction
- Using Qt RemoteObjects
- Troubleshooting Qt Remote Objects

### Reference

Qt Remote Objects C++ Classes