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. DBUS Array & Dict
Forum Updated to NodeBB v4.3 + New Features

DBUS Array & Dict

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.9k 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.
  • L Offline
    L Offline
    lucasbetschart
    wrote on last edited by
    #1

    Hi Qt Community,

    I try to implement the Freedesktop.org Notification Specifications as a small Qt library. It uses DBUS.
    GetCapabilities, GetServerInformation etc works fine, but I've got some problems with the most important part, the notify:
    http://www.galago-project.org/specs/notification/0.9/x408.html#command-notify

    I'm not able to create a DBUS Array and Dict. I've tried with QDBusArgument, but I don't understand how it works for more complex data types. Can somebody please give me an example of how to build an Array of String for QDBus and a Dict as described here: http://www.galago-project.org/specs/notification/0.9/x344.html

    Thank you.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guziemic
      wrote on last edited by
      #2

      Hi,

      In case of Array of Strings, so DBus signature 'as ' Qt does all job for you. It is enough if you use QStringList as a type of your variable.

      In case of most complex data like some structures with strings and integers etc. I think that you should define your own structure, create read/write operators for it, declare it as a new metatype and it should work.

      Some documentation about it "QDBusArgument":http://doc.qt.digia.com/4.7-snapshot/qdbusargument.html

      But you can also start from XML definition and then use code generation to genereate proxy client of your DBus methods. "Some documents":http://www.developer.nokia.com/Community/Wiki/QtDbus_quick_tutorial

      BR,

      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