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
を使用して設定できます:
オプション | 値 | 説明 |
---|---|---|
CLASSNAME | class_name | デフォルトのインターフェース・クラス名をclass_name で上書きする。 |
NO_NAMESPACE | ブーリアン | ON に設定されている場合、名前空間名を生成しません。 |
INCLUDE | path | 生成されるコードに#include "path" を追加します。 |
© 2025 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.