QDBusVirtualObject Class

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

头文件: #include <QDBusVirtualObject>
qmake: QT += dbus
开始支持版本: Qt 5.1
基类: QObject

公有函数

QDBusVirtualObject(QObject *parent = Q_NULLPTR)
virtual ~QDBusVirtualObject()
virtual bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) = 0
virtual QString introspect(const QString &path) const = 0
  • 32 个公有函数继承自 QObject

其他继承的成员

  • 1 个属性继承自 QObject
  • 1 个公有槽函数继承自 QObject
  • 2 个信号继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

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

成员函数

QDBusVirtualObject::QDBusVirtualObject(QObject *parent = Q_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" />
  </interface>

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