Introspect is required to discover properties that are accessed via QObject::property(). If it is not present, but the names and signature of the properties are known by looking at the source code of the remote interface, the D-Bus property system can be used manually, with these methods:

Introspect is required to discover properties that are accessed via QObject::property(). If it is not present, but the names and signature of the properties are known by looking at the source code of the remote interface, the D-Bus property system can be used manually, with these methods:

Contents

The basic techniques explained in Accessing Interfaces are suitable for using D-Bus methods with relatively simple signatures, but the more complex interfaces often found in the wild require additional techniques to address, explained in this article.

QtDBus requires additional setup to deal with methods that return more complex return types than single primitives. The return type needs to be declared to the Qt type system so that it can be demarshalled.

Some D-Bus methods return an arbitrary tuple of values. The QDBusReply class can only handle the first value returned by a method, so to get the rest of the returned parameters we fall back to using QDBusMessage. Since QDBusAbstractInterface::call() and similar actually return QDBusMessage, when we use QDBusReply we are actually just constructing this from the QDBusMessage containing all the return values.

QDBusInterface, as a proxy for the remote D-Bus interface, makes use of introspection to provide high level access to D-Bus signals and properties. However, the object must support the interface org.freedesktop.DBus.Introspectable to do so, which is not mandatory.

Introspect is required to discover properties that are accessed via QObject::property(). If it is not present, but the names and signature of the properties are known by looking at the source code of the remote interface, the D-Bus property system can be used manually, with these methods:

If Introspect is not supported, QObject::connect() will get a 'no such signal' error at runtime.

It is still possible to connect to these signals with QtDBus, at a lower level, using QDBusConnection::connect(). If you are using QDBusInterface for its convenient call() methods, get its connection and call connect() on this: