qt_add_dbus_interfaces

Generates C++ sources implementing interfaces for D-Bus interface description files.

The command is defined in the DBus 组件对于 Qt6 package. Load the package with:

find_package(Qt6 REQUIRED COMPONENTS DBus)
					

This command was introduced in Qt 6.0.

概要

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

versionless commands are disabled, use qt6_add_dbus_interfaces() instead. It supports the same set of arguments as this command.

描述

生成 C++ 源,实现 D-Bus 接口的定义在 dbus_spec1 , dbus_spec2 ,其中各自变量需要是有效 D-Bus 接口描述文件的路径。将生成文件的路径添加到 <VAR> .

对于各自变量,调用 Qt D-Bus XML 编译器 (qdbusxml2cpp) 按设置的接口 (代理) 模式。

生成的 C++ 源文件的命名后于 XML 文件:对于文件 org.example.chat.xml ,生成的 Header (头) 文件称为 orgexamplechatinterface.h .

选项

可以设置选项使用 set_source_files_properties 对于各文件自变量:

选项 描述
CLASSNAME class_name 覆写默认接口类名采用 class_name .
NO_NAMESPACE boolean 不生成命名空间的名称,若设为 ON .
INCLUDE path 添加 #include "path" 在生成的代码中。