我正在Ubuntu上编程C++,使用QDBus,我有以下代码片段:
this->m_cRemoteInterface = new QDBusInterface("org.my.service", "/data", "org.freedesktop.DBus.Properties.Get");
QDBusReply<uint64_t> cResult = m_cRemoteInterface->call("property1");代码引发以下错误:
org.freedesktop.DBus.Error.UnknownMethod:在接口"org.freedesktop.DBus.Properties.Get“上不存在带有签名”org.freedesktop.DBus.Properties.Get“的方法"property1”
但是,当我在shell中发出以下命令时,它将返回正确的值:
dbus org.my.service /data org.freedesktop.DBus.Properties.Get“property1”
我能做什么错事?
谢谢你,百代
发布于 2010-08-11 12:06:47
经过一下午的摸索和错误之后:
我宣布
org.freedesktop.DBus.Properties.Get
作为接口,这是不对的。
我只能用
org.freedesktop.DBus.Properties
作为接口,然后
调用(“Get”、"property1");
希望这能帮上忙。*)。
https://stackoverflow.com/questions/3456581
复制相似问题