Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qdbusreply: unexpected reply signature?
Forum Update on Monday, May 27th 2025

qdbusreply: unexpected reply signature?

Scheduled Pinned Locked Moved Unsolved General and Desktop
dbusqdbussignatureerror
2 Posts 1 Posters 818 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    flodo
    wrote on 1 Mar 2022, 00:15 last edited by flodo 3 Jan 2022, 00:18
    #1

    What's wrong with the following snippet?
    I am constantly getting the error

    Unexpected 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?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      flodo
      wrote on 1 Mar 2022, 12:54 last edited by
      #2

      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>();
          // ...
      }
      
      1 Reply Last reply
      3

      1/2

      1 Mar 2022, 00:15

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved