【问题标题】:Maximum number of arguments for qdbusxml2cppqdbusxml2cpp 的最大参数数
【发布时间】:2012-09-21 18:21:56
【问题描述】:

我正在使用 Qt 在 linux 构建机器上扩展 DBus 接口。现有界面运行良好,我需要添加另一个参数

XML生成方法生成为:

<method name="get_card_info">
  <arg type="b" name="success" direction="out" />      
  <arg type="s" name="version" direction="out" />
  <arg type="s" name="serial" direction="out" />
  <arg type="s" name="BeginDate" direction="out" />
  <arg type="s" name="ExpirationDate" direction="out" />
  <arg type="s" name="RenewalDate" direction="out" />
  <arg type="s" name="ZipCode" direction="out" />
  <arg type="s" name="ZipCodeExtension" direction="out" />
  <!--  <arg type="u" name="cardStatus" direction="out" />  -->
</method>

代码工作正常,直到我取消注释掉注释行,此时 qdbusxml2cpp 报告:

interface_dbus_p.h:39:103: error: wrong number of template arguments (9, should be 8)

即使我注释掉了对该函数的所有调用;确实这是在链接代码甚至被编译之前;这全部来自 qdbusxml2cpp 调用。

如果我将其更改为六、七或八项,XML 将编译,但如果我将其增加到九项,则会崩溃。

除了 XML 代码,我没有更改任何其他配置文件。

怎么了?是否有八个参数的限制?

【问题讨论】:

    标签: c++ linux qt


    【解决方案1】:

    找到了;是的,有一个限制,感谢QDBusPendingReply

    “QDBusPendingReply 是一个模板类,最多有 8 个模板参数。这些参数是用于提取回复数据内容的类型。”

    所以对我来说不超过 8 个参数:(

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-19
      • 1970-01-01
      • 2012-12-03
      • 1970-01-01
      • 2011-05-10
      • 1970-01-01
      • 2014-06-28
      相关资源
      最近更新 更多