如何通过 qdbusxml2cpp 在自动生成的绑定代码中添加标头



$qdbusxml 2cpp -v -c CustomIf -p customif.h:customif.cpp org.item.custom.xml

org.item.custom.xml

<node>
<interface name="org.pace.custom">
<method name="Send_Custom_Msg">
<arg name="msg" type="a(ii)" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="Message"/>
</method>
<signal name="LateEvent">
<arg name="eventkind" type="s" direction="out"/>
</signal>
</interface>
</node>

如何在生成的适配器 customif.h 中添加标头 - message.h?我不想手动添加 #include"message.h",但实际上希望 qdbusxml2cpp 添加包含。

使用以下选项:

-i <filename> Add #include to the output

因此,这将是相应的命令:

qdbusxml2cpp -v -i message.h -c CustomIf -p customif.h:customif.cpp org.item.custom.xml

最新更新