简体   繁体   English

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

[英]QDBus problem: getting org.freedesktop.DBus.Error.UnknownMethod, but method exists

I'm programming C++ on Ubuntu, using QDBus and I've got the following code snippet: 我正在使用QDBus在Ubuntu上进行C ++编程,并且获得了以下代码片段:

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 org.freedesktop.DBus.Error.UnknownMethod:接口“ org.freedesktop.DBus.Properties.Get”上具有签名“”的方法“ property1”不存在

But when I issue the following command in a shell, it returns the correct value: 但是,当我在shell中发出以下命令时,它将返回正确的值:

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

What could I do wrong? 我该怎么办?

Thanks in advance, emi 在此先感谢emi

After an afternoon of trail and error: 经过一连串的错误:

I declared 我宣布

org.freedesktop.DBus.Properties.Get org.freedesktop.DBus.Properties.Get

as interface, which is not right. 作为接口,这是不对的。

I had to use only 我只用

org.freedesktop.DBus.Properties org.freedesktop.DBus.Properties

as interface and then 作为接口,然后

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

May this help someone. 可以帮助别人。 :). :)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.freedesktop.DBus.Properties.GetAll 返回“g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: 没有这样的接口”“” - org.freedesktop.DBus.Properties.GetAll returns "g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface “”" linux交叉编译链接器问题,带有对“ g_thread_init”和“ org_freedesktop_DBus_request_name”的未定义引用 - linux cross compiling linker issue with undefined reference to `g_thread_init' and `org_freedesktop_DBus_request_name' ubuntu 上的 docker 登录超时`为 org.freedesktop.secrets 调用 StartServiceByName 时出错:已达到超时` - docker login timeout on ubuntu `Error calling StartServiceByName for org.freedesktop.secrets: Timeout was reached` Dropbox 要求进行身份验证:org.freedesktop.policykit.exec: /bin/sh - Dropbox is asking for authentication : org.freedesktop.policykit.exec : /bin/sh dbus:dbus_bus_get_unique_name问题 - dbus: problem with dbus_bus_get_unique_name 将struct传递给dbus方法的工具? - A tool to pass struct to dbus method? 在Linux中的网络管理器的接口“ org.freedesktop.NetworkManager.Device”上生成的信号名称 - signal names generated on interface “org.freedesktop.NetworkManager.Device” of Network Manager in linux KeeWeb 失败:nixos 上的 any.service 文件未提供名称 org,freedesktop.secrets - KeeWeb fails: the name org,freedesktop.secrets was not provided by any .service files on nixos "<i>DBus.Error.AccessDenied: Rejected.<\/i> DBus.Error.AccessDenied:被拒绝。<\/b> <i>DBUS over TCP<\/i>基于 TCP 的 DBUS<\/b>" - DBus.Error.AccessDenied: Rejected. DBUS over TCP DBus与其他进程间通信方法的区别 - Difference between DBus and other Interprocess Communications method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM