Results 1 to 2 of 2

Thread: Qt and dbus

  1. #1
    Join Date
    Aug 2011
    Posts
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt and dbus

    This is probaply easy but still ... how to get properties of dbus interfaces?

    I.e. I do have:
    QDBusInterface adbus_iface("org.freedesktop.Accounts", "/org/freedesktop/Accounts/User1000",
    "org.freedesktop.Accounts.User", bus);
    qDebug() << adbus_iface.call( "UserName").arguments().at(0);

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt and dbus

    The interface description says that UserName is a property. Properties aren't callable, only methods are.

    Try this instead
    Qt Code:
    1. qDebug() << adbus_iface.property("UserName");
    To copy to clipboard, switch view to plain text mode 

    In general I would recommend to use the tools that Qt has to make this more convenient, i.e. qdbusxml2cpp to generate a Qt class from the interface description.

    Cheers,
    _

Similar Threads

  1. <QtDBus/QtDBus> / <dbus/dbus.h>
    By migel in forum Newbie
    Replies: 3
    Last Post: 3rd August 2011, 15:09
  2. DBus Q_SCRIPTABLE
    By Corinzio in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2009, 19:39
  3. need DBus help
    By nrabara in forum Newbie
    Replies: 2
    Last Post: 2nd May 2009, 07:41
  4. Qt 4.5.0 win opensource and <dbus/dbus.h>
    By YaK in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd March 2009, 11:06
  5. DBus and IPC
    By DrDonut in forum Qt Programming
    Replies: 3
    Last Post: 22nd March 2008, 23:42

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.