Qt D-Bus

D-Bus is an Inter-Process Communication (IPC) and Remote Procedure Calling (RPC) mechanism originally developed for Linux to replace existing and competing IPC solutions with one unified protocol. It was also designed to allow communication between system-level processes (such as printer and hardware driver services) and normal user processes.

It uses a fast, binary message-passing protocol, which is suitable for same-machine communication due to its low latency and low overhead. Its specification is currently defined by the freedesktop.org project and is available to all parties.

Communication, in general, happens through a central server application called the "bus" (hence the name), but direct application-to-application communication is also possible. When communicating on a bus, applications can query which other applications and services are available, as well as activate one on demand.

Using the Module

Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.

Use the find_package() command to locate the needed module component in the Qt6 package:

find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)

For more details, see the Build with CMake overview.

Articles and Guides

The following documents contain information about Qt's D-Bus integration features and provide details about the mechanisms used to send and receive type information over the bus:

Examples

Reference

Module Evolution

Changes to Qt D-Bus lists important changes in the module API and functionality that were made for the Qt 6 series of Qt.

Licenses and Attributions

The Qt D-Bus module is available under commercial licenses from The Qt Company. In addition, it is available under free software licenses: The GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.

Furthermore, Qt D-Bus in Qt 6.8.0 may contain third party modules under the following permissive licenses:

libdus-1 headers, version dbus-1.13.12

Academic Free License v2.1, or GNU General Public License v2.0 or later

© 2024 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.