Inter-Process Communication in Qt#
Inter-Process communication in Qt applications.
Qt provides several ways to implement Inter-Process Communication (IPC) in Qt applications.
The cross-platform Qt Network module provides classes that make network programming portable and easy. It offers high-level classes (e.g.
QNetworkAccessManager ) that communicate using specific application-level protocols, and lower-level classes (e.g.,
QSslSocket ) for implementing protocols.
The cross-platform Qt Network module provides classes that make local network programming portable and easy. It offers the
QLocalSocket classes that allow for network-like communication in a local setup. Their TCP counterparts can be used as drop-in replacement to make the communication work across networks.
The Qt D-Bus module is a Unix-only library you can use to implement IPC using the D-Bus protocol. It extends Qt’s Signals and Slots mechanism to the IPC level, allowing a signal emitted by one process to be connected to a slot in another process. The Qt D-Bus documentation has detailed information on how to use the Qt D-Bus module.
The cross-platform class
QProcess can be used to start external programs as child processes, and to communicate with them. It provides an API for monitoring and controlling the state of the child process.
QProcess gives access to the input/output channels of child process by inheriting from
On Linux/X11, Windows and macOS, Qt provides support for session management. Sessions allow events to be propagated to processes, for example, to notify when a shutdown occurs. The process and applications can then perform any necessary operations such as save open documents.