首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QDBus问题:获取org.freedesktop.DBus.Error.UnknownMethod,但存在方法

QDBus问题:获取org.freedesktop.DBus.Error.UnknownMethod,但存在方法
EN

Stack Overflow用户
提问于 2010-08-11 08:23:55
回答 1查看 2.3K关注 0票数 0

我正在Ubuntu上编程C++,使用QDBus,我有以下代码片段:

代码语言:javascript
复制
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”

我能做什么错事?

谢谢你,百代

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-08-11 12:06:47

经过一下午的摸索和错误之后:

我宣布

org.freedesktop.DBus.Properties.Get

作为接口,这是不对的。

我只能用

org.freedesktop.DBus.Properties

作为接口,然后

调用(“Get”、"property1");

希望这能帮上忙。*)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3456581

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档