1

$qdbusxml2cpp -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 添加包含。

4

1 回答 1

2

使用以下选项:

-i <filename> Add #include to the output

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

qdbusxml2cpp -v -i message.h -c CustomIf -p customif.h:customif.cpp org.item.custom.xml
于 2014-02-24T03:52:37.803 回答