このページでは

qt_add_dbus_interfaces

D-Busインターフェース記述ファイル用のインターフェースを実装するC++ソースコードを生成します。

このコマンドは、Qt6 パッケージのDBus コンポーネントで定義されています。以下のコマンドでパッケージを読み込みます:

find_package(Qt6 REQUIRED COMPONENTS DBus)

このコマンドは Qt 6.0 で導入されました。

概要

qt_add_dbus_interfaces(<VAR> dbus_spec1 [dbus_spec2 ...])

バージョン指定なしのコマンドが無効になっている場合は、代わりに `qt6_add_dbus_interfaces() ` を使用してください。このコマンドと同じ引数セットをサポートしています。

説明

dbus_spec1 およびdbus_spec2 で定義された D-Bus インターフェースを実装する C++ ソースを生成します。各引数には、有効な D-Bus インターフェース記述ファイルへのパスを指定する必要があります。生成されたファイルのパスは、<VAR> に追加されます。

各引数に対して、Qt D-Bus XML コンパイラ (qdbusxml2cpp)をインターフェース (プロキシ) モードで呼び出す処理が設定されます。

生成された C++ ソースファイルは、XML ファイルの名前に基づいて命名されます。たとえば、ファイルorg.example.chat.xml の場合、生成されるヘッダーファイルの名前はorgexamplechatinterface.h となります。

オプション

各ファイル引数に対して、set_source_files_properties を使用してオプションを設定できます:

オプション値説明
CLASSNAMEclass_nameclass_name を使用して、デフォルトのインターフェースクラス名を上書きします。
NO_NAMESPACEbooleanON に設定された場合、名前空間付き名を生成しません。
INCLUDEpath生成されたコードに#include "path" を追加します。

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