0

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");

コードは次のエラーをスローします。

org.freedesktop.DBus.Error.UnknownMethod: インターフェース「org.freedesktop.DBus.Properties.Get」の署名「」を持つメソッド「property1」が存在しません

しかし、シェルで次のコマンドを発行すると、正しい値が返されます。

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

何が間違っている可能性がありますか?

前もってありがとう、エミ

4

1 に答える 1

0

試行錯誤の午後の後:

私は宣言した

org.freedesktop.DBus.Properties.Get

インターフェイスとして、これは正しくありません。

使うしかなかった

org.freedesktop.DBus.Properties

インターフェースとして

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

これが誰かを助けるかもしれません。:)。

于 2010-08-11T12:06:47.070 に答える