views:

19

answers:

1

I'm programming C++ on Ubuntu, using QDBus and I've got the following code snippet:

this->m_cRemoteInterface = new QDBusInterface("org.my.service", "/data", "org.freedesktop.DBus.Properties.Get"); 

QDBusReply<uint64_t> cResult = m_cRemoteInterface->call("property1");

The code throws the following error:

org.freedesktop.DBus.Error.UnknownMethod: Method "property1" with signature "" on interface "org.freedesktop.DBus.Properties.Get" doesn't exist

But when I issue the following command in a shell, it returns the correct value:

dbus org.my.service /data org.freedesktop.DBus.Properties.Get " " property1

What could I do wrong?

Thanks in advance, emi

A: 

After an afternoon of trail and error:

I declared

org.freedesktop.DBus.Properties.Get

as interface, which is not right.

I had to use only

org.freedesktop.DBus.Properties

as interface and then

call("Get", " ", "property1");

May this help someone. :).

Emiswelt