Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QtDBus complex types in Variant
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QtDBus complex types in Variant

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chrisco
    wrote on last edited by
    #1

    Anybody have an idea how to use complex types (struct, dicts, arrays) in variants?

    E.g. DBus method:
    @
    <method name="RequestResultList">
    .
    .
    <arg name="resultListWindow" type="a(uuqa(sqv))" direction="out">
    <doc>
    <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>
    </doc>
    </arg>
    .
    .
    </method>
    @

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chrisco
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          AFAIU (from the doc), for QDBusVariant to understand your structure, you have to register it first.

          Did you do that ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            chrisco
            wrote on last edited by
            #5

            Yes i did.

            The following solution works:
            https://bugreports.qt-project.org/browse/QTBUG-32227

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved