代码之家  ›  专栏  ›  技术社区  ›  Emiswelt

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

  •  0
  • Emiswelt  · 技术社区  · 15 年前

    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中发出以下命令时,它将返回正确的值:

    数据总线org.my.service /数据org.freedesktop.DBus.Properties.Get " “物业1

    我能做错什么?

    1 回复  |  直到 15 年前
        1
  •  0
  •   Emiswelt    15 年前

    经过一下午的反复试验:

    我宣布

    org.freedesktop.DBus.Properties.Get

    作为接口,这是不对的。

    org.freedesktop.DBus.Properties

    作为接口,然后

    call(“Get”,“”,“property1”);

    推荐文章