如何通过q​​dbusxml2cpp在自动生成的绑定代码中添加标头?

时间:2014-02-24 03:41:05

标签: qt qtdbus qdbusxml2cpp

$ 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&#34; message.h&#34;,但实际上想要qdbusxml2cpp添加包含。

1 个答案:

答案 0 :(得分:2)

使用以下选项:

-i <filename> Add #include to the output

所以,这将是相应的命令:

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