【问题标题】:QDBus problem: getting org.freedesktop.DBus.Error.UnknownMethod, but method existsQDBus 问题:获取 org.freedesktop.DBus.Error.UnknownMethod,但方法存在
【发布时间】:2011-03-28 06:16:11
【问题描述】:

我在 Ubuntu 上使用 QDBus 编写 C++,我有以下代码 sn-p:

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: 方法“property1” 界面上的签名“” “org.freedesktop.DBus.Properties.Get” 不存在

但是当我在 shell 中发出以下命令时,它会返回正确的值:

dbus org.my.service /data org.freedesktop.DBus.Properties.Get " " 属性1

我会做错什么?

提前致谢,emi

【问题讨论】:

    标签: linux ubuntu methods dbus


    【解决方案1】:

    经过一下午的反复试验:

    我声明

    org.freedesktop.DBus.Properties.Get

    作为接口,这是不对的。

    我只能使用

    org.freedesktop.DBus.Properties

    作为接口然后

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

    希望这对某人有所帮助。 :)。

    【讨论】:

      猜你喜欢
      • 2021-06-07
      • 1970-01-01
      • 1970-01-01
      • 2014-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-01
      • 1970-01-01
      相关资源
      最近更新 更多