PDA

View Full Version : Qt and dbus



matsukan
9th January 2014, 22:05
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);

anda_skoa
10th January 2014, 10:27
The interface description says that UserName is a property. Properties aren't callable, only methods are.

Try this instead


qDebug() << adbus_iface.property("UserName");


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,
_