このページでは

QDBusVirtualObject Class

QDBusVirtualObject クラスは、1つのクラスで複数の DBus パスを処理するために使用されます。詳細...

ヘッダー: #include <QDBusVirtualObject>
CMake: find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)
qmake: QT += dbus
継承元: QObject

パブリック関数

QDBusVirtualObject(QObject *parent = nullptr)
virtual ~QDBusVirtualObject()
virtual bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) = 0
virtual QString introspect(const QString &path) const = 0

詳細な説明

メンバ関数のドキュメント

[explicit] QDBusVirtualObject::QDBusVirtualObject(QObject *parent = nullptr)

parent を使用して、QDBusVirtualObjectを構築します。

[virtual noexcept] QDBusVirtualObject::~QDBusVirtualObject()

オブジェクトを破棄し、そのすべての子オブジェクトを削除します。

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

この関数は、SubPath オプションが指定されている場合、仮想オブジェクトのパス宛てのすべてのメッセージを処理する必要があります。サービス、パス、インターフェース、およびメソッドはすべて、message の一部です。パラメータ `connection ` は接続ハンドルです。メッセージの処理が完了した場合は `true ` を返さなければなりません。そうでない場合は `false ` を返す必要があります(この場合、DBus エラーメッセージが発生します)。

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

この関数は、path における仮想オブジェクトのイントロスペクションを処理する必要があります。以下の形式の XML を返す必要があります。

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

SubPath オプションを指定した場合、このイントロスペクションにはすべての子ノードを含める必要があります。指定しない場合、QDBus が子ノードのイントロスペクションを処理します。

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