/Qt 5.11

QDBusVirtualObject Class

The QDBusVirtualObject class is used to handle several DBus paths with one class. More...

Header: #include <QDBusVirtualObject>
qmake: QT += dbus
Since: Qt 5.1
Inherits: QObject

Public Functions

QDBusVirtualObject(QObject *parent = nullptr)
virtual ~QDBusVirtualObject()
virtual bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) = 0
virtual QString introspect(const QString &path) const = 0
  • 34 public functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 2 signals inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QDBusVirtualObject class is used to handle several DBus paths with one class.

Member Function Documentation

QDBusVirtualObject::QDBusVirtualObject(QObject *parent = nullptr)

Constructs a QDBusVirtualObject with parent.

[virtual] QDBusVirtualObject::~QDBusVirtualObject()

Destroys the object, deleting all of its child objects.

[pure virtual] bool QDBusVirtualObject::handleMessage(const QDBusMessage &message, const QDBusConnection &connection)

This function needs to handle all messages to the path of the virtual object, when the SubPath option is specified. The service, path, interface and methos are all part of the message. Parameter connection is the connection handle. Must return true when the message is handled, otherwise false (will generate dbus error message).

[pure virtual] QString QDBusVirtualObject::introspect(const QString &path) const

This function needs to handle the introspection of the virtual object on path. It must return xml of the form:

<interface name="org.qtproject.QtDBus.MyObject" >
    <property access="readwrite" type="i" name="prop1" />

If you pass the SubPath option, this introspection has to include all child nodes. Otherwise QDBus handles the introspection of the child nodes.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.