[Interest] Question about using QtDBus

Rogers Nate nate.rogers at raymondcorp.com
Thu Aug 28 22:16:56 CEST 2014


On 08/28/2014 03:18 PM, Thiago Macieira wrote:
It should be. Can you tell us a little more? Is your slot called at all? If not, what error does the caller get when trying to call it? If so, is any warning printed after return?

When I build it with type "ao" in the ServiceData.xml file, I get this warning at runtime...


QDBusError("org.freedesktop.DBus.Error.InvalidSignature", "Unexpected reply signature: got "ao", expected "a(ss)"")

So I updated my xml file to read...

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"<http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd>>
<node>
  <interface name="com.GDM.ServiceData">
    <method name="serviceErrorLog">
        <arg name="serviceErrorLogData" type="ao" direction="out"/>
    </method>
  </interface>
</node>

When I change the xml file to have a(ss) as the type instead of ao, qtcreator shows a build error that suggests I need to add the following...

You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description

So I updated my xml file to look like this...

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"<http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd>>
<node>
  <interface name="com.GDM.ServiceData">
    <method name="serviceErrorLog">
        <arg name="serviceErrorLogData" type="a(ss)" direction="out"/>
        <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="ServiceErrorLogData"/>
    </method>
  </interface>
</node>

and I got this warning...


servicedata_adaptor.cpp:36:1: error: 'ServiceErrorLogData' does not name a type

ServiceErrorLogData ServiceDataAdaptor::serviceErrorLog()

^

make[1]: *** [servicedata_adaptor.o] Error 1

So I tried to change it to <QList>ServiceErrorLogData and I got...

Got unknown type `a(ss)'

You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description

make[1]: *** [servicedata_adaptor.h] Error 1

make: *** [sub-DataProcess-DataProcess-pro-make_first] Error 2

16:11:10: The process "/usr/bin/make" exited with code 2.

Error while building/deploying project dbustest (kit: MEL Qt 5.2.1)

When executing step 'Make'

What should I set the <Type> to in the xml file? Thanks!


Nate




Confidentiality Notice: The preceding e-mail message (including any attachments) contains information that may be confidential, protected by applicable legal privileges, or constitute non-public information. It is intended to be conveyed only to the designated recipient(s). If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution or reproduction of this message by unintended recipients is not authorized and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140828/7b049618/attachment.html>


More information about the Interest mailing list