qdbusreply: unexpected reply signature?
Unsolved
General and Desktop
-
wrote on 1 Mar 2022, 00:15 last edited by flodo 3 Jan 2022, 00:18
What's wrong with the following snippet?
I am constantly getting the errorUnexpected reply signature: got "a{sa{sv}}", expected "" (QMap<QString,QVariantMap>)
Snippet:
QDBusInterface connIface( NM_DBUS_SERVICE, "/org/freedesktop/NetworkManager/Settings/1", NM_DBUS_INTERFACE_SETTINGS_CONNECTION, QDBusConnection::systemBus()); QDBusReply<QMap<QString, QMap<QString, QVariant>> > settingsResult = connIface.call("GetSettings");
I really don't get it. Why is the signature once shown in the short format and once in the long one?
The code itself seems perfectly fine to me. Is it possible that this has to do with the compiler / header / dbuslib-versions somehow?
-
wrote on 1 Mar 2022, 12:54 last edited by
You have to register the expected Response first!
In my case it was like
#include <QtDBus/QDBusMetaType> // ... typedef QMap<QString, QMap<QString, QVariant> > ConnectionDetails; Q_DECLARE_METATYPE(ConnectionDetails)
and
int main() { qDBusRegisterMetaType<ConnectionDetails>(); // ... }
2/2