[SOLVED] QtDBus complex types in Variant
Anybody have an idea how to use complex types (struct, dicts, arrays) in variants?
E.g. DBus method:
<arg name="resultListWindow" type="a(uuqa(sqv))" direction="out">
<line>resultListWindow = array[struct(unique_id, distance, route_status, attributes)]</line>
<line>type = enum(INVALID,STRING,INTEGER,COORDINATES ...)</line>
<line>value = value. The value depends on the attribute specifications and type.</line>
The 'v' variant can return a (ddi) struct in case of coordinates.
Registering (ddi) struct type and casting the returned QDBusVariant to that (ddi) struct does not seem to work.
Does anybody have an idea how to get complex types in 'v' variants working?
I am not dbus experimented, but did you look at the "QtDBus type system":http://qt-project.org/doc/qt-4.8/qdbustypesystem.html doc ?
Hi. Yes, i know that page. Does not really contain helpful information about this particular case (getting complex types out of variant), but thanks for the reply.
AFAIU (from the doc), for QDBusVariant to understand your structure, you have to register it first.
Did you do that ?
Yes i did.
The following solution works: