qt_generate_dbus_interface
根据头文件生成 D-Bus 接口。
该命令定义在Qt6 包的DBus 组件中。使用以下命令加载该包:
find_package(Qt6 REQUIRED COMPONENTS DBus)该命令于 Qt 6.0 中引入。
语法
qt_generate_dbus_interface(header
[customName]
[OPTIONS options]
)如果禁用了无版本号的命令,请改用qt6_generate_dbus_interface() 。它支持与本命令相同的参数集。
描述
解析包含QObject 派生类声明的 C++ 源文件或头文件,并生成一个包含 D-Bus 内省 XML 的文件。
默认情况下,生成的 XML 文件存储在当前二进制目录中,且其基名与头文件相同。您可以通过将customName 作为可选的第二个参数添加来指定不同的名称或路径。
选项
该函数用于调用qdbuscpp2xml 命令行工具。该工具的其他参数可在OPTIONS 之后进行设置。
© 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.