c++ - qdbusxml2cpp 的最大参数数

标签 c++ linux qt

我正在使用 Qt 在 Linux 构建机器上扩展 DBus 接口(interface)。现有的接口(interface)工作正常,我需要添加另一个参数

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 代码之外,我没有更改其他配置文件。

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

最佳答案

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

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

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

关于c++ - qdbusxml2cpp 的最大参数数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12528490/

相关文章:

c++ - F#:使用自定义类型参数调用 native 函数

linux - 删除所有具有相似模式且日期小于特定日期的文件

linux - Makefile:649: *** 缺少分隔符。停止

c++ - 在 Mac OS X 上使用 Qwt

C++类函数继承使用从基类继承的另一个类的变量

c++ - cmake 不使用 boost 多线程库

c++ - GTK+ 警告 : Can't set a parent on widget which has a parent

python - 从旧数据库复制到 Couchdb 中的新数据库

c++ - 如何在 Qt 中调整像素图的大小?

c++ - 如何删除网格查看器上选择性表面内的边缘?