2010-08-11 19 views
0

我在Ubuntu編程的C++,使用QDBus和我有下面的代碼片段:QDBus問題:越來越org.freedesktop.DBus.Error.UnknownMethod,但方法存在

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: Method "property1" with signature "" on interface "org.freedesktop.DBus.Properties.Get" doesn't exist

但是,當我在shell發出以下命令,它返回正確的值:

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

我能做什麼錯?

由於提前,EMI

回答

0

試錯的一個下午後:

我宣佈

org.freedesktop.DBus.Properties.Get

的接口,這是不對的。

我不得不使用僅

org.freedesktop.DBus.Properties

的接口,然後

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

願這幫助別人

。 :)。