[Qt-interest] QtDBus complex type marshalling

Kevron Rees kev000x at yahoo.com
Mon Mar 9 12:29:24 CET 2009


I'm working on a networkmanager interface application and I've hit the wall trying to marshal a complex reply message into something I can read.  The DBus method is as follows:

interface: org.freedesktop.NetworkManagerSettings.Connection
method: GetSettings() -> returns: a{sa{sv}}

Here's the code I have so far to try and parse it:

 
QDBusMessage reply = call("GetSettings");
QDBusArgument arg = reply.arguments().at(0).value<QDBusArgument>();
QList<QMap<QString,QList< QMap<QString, QVariant> > > > obj;
arg>>obj;
cout<<"initial size: "<<obj.size()<<endl;The QList<QMap<QString,QList< QMap<QString, QVariant>>>> seems like the right type.  But it produces a bunch of runtime errors:

 
process 21919: type array 97 not a basic type
process 21919: You can't recurse into an empty array or off the end of a message body
process 21919: type dict_entry 101 not a basic type
process 21919: type invalid 0 not a basic type
process 21919: You can't recurse into an empty array or off the end of a message body
QDBusDemarshaller: Found unknown D-Bus type 1 ''
QDBusDemarshaller: Found unknown D-Bus type 0 '
process 21919: type array 97 not a basic type
process 21919: You can't recurse into an empty array or off the end of a message body
process 21919: type dict_entry 101 not a basic type
process 21919: type invalid 0 not a basic type
process 21919: You can't recurse into an empty array or off the end of a message body
QDBusDemarshaller: Found unknown D-Bus type 1 ''
process 21919: type invalid 0 not a basic type
process 21919: You can't recurse into an empty array or off the end of a message body
QDBusDemarshaller: Found unknown D-Bus type 1 ''
initial size: 2

As you can see from the output, the array size is "2". 


Furthermore, qdbusxml2cpp on the interfaces introspection returns:

Got unknown type `a{sa{sv}}'
You should add <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description


Therefore I can't rely on autogeneration of the class to solve my issue.

Please help!!



      




More information about the Qt-interest-old mailing list