qt_add_dbus_interface

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

このコマンドはQt6 パッケージのDBus コンポーネントで定義されています。でパッケージをロードします:

find_package(Qt6 REQUIRED COMPONENTS DBus)

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

概要

qt_add_dbus_interface(<VAR> dbus_spec basename)

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

説明

dbus_spec で定義された D-Bus インタフェース記述ファイルのインタフェースを実装する C++ ソースを生成します。生成されるファイルはbasename にちなんで命名されます:basename.h,basename.cpp,basename.moc 。ファイルのパスは<VAR> に追加されます。

この関数は、インターフェース(プロキシ)モードでQt D-Bus XML コンパイラ(qdbusxml2cpp)の呼び出しを設定します。デフォルトでは、qdbusxml2cpp は、名前空間エイリアスを持つ、インターフェース名にちなんだ C++ クラスを生成します:

D-Bus インタフェース名クラス名名前空間名
org.example.chatOrgExampleChatInterfaceorg.example.chat

オプション

オプションは、dbus_specset_source_files_properties を使用して設定できます:

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