title: How do I parse Dict of {String, Dict of {String, Variant}} with QDBus?
body: <p>I am querying NetworkManager's <code>org.freedesktop.NetworkManager.Settings.Connection</code> interface, calling "GetSettings" on it. It returns a <code>Dict of {String, Dict of {String, Variant}}</code> or <code>a{sa{sv}}</code> in Dbus type terms. I'm using QtCreator with Qt4 to build my application.</p>
  
  <p>I cannot seem to get a piece of useable information out of this dictionary.
  I cannot provide a MVE as it is heavily dependent if NetworkManager and DBus and Qt4 is installed on someone's system. </p>
  
  <p>Here is the method I am developing to get information out of this Dictionary of Strings and Dictionary of Strings and Variants. I can see all the nice data that I want when piping it into qDebug(): <code>qDebug()&lt;&lt;reply</code>.</p>
  
  <pre><code>void GetInfo()
  {
      //sysbus just means the system DBus.
      QDBusInterface connSettings("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings/1", "org.freedesktop.NetworkManager.Settings.Connection", sysbus);
      QDBusMessage reply = connections.call("GetSettings");
      if(reply.type() == QDBusMessage::ReplyMessage)
      {
          //I have tried everything I can imagine here,
          //QVariant g = reply.arguments().at(0).value&lt;QVariant&gt;(); did not work
          //g.canConvert&lt;QMap&gt;(); returns false, in contrast to what KDE says.
          //QDbusArgument g = query.arguments().at(0).value&lt;QDBusArgument&gt;();
          //g.beginMap(); and such don't work
      }
  }
  </code></pre>
  
  <p>It's very hard finding information on parsing a Dict type. The only source I found that provides some info is <a href="https://techbase.kde.org/Development/Tutorials/D-Bus/Intermediate_D-Bus#Dicts" rel="nofollow noreferrer">KDE</a>. It says "The DBus Dict type should map to QMap, example to follow.." and no other hits on Google or examples exist. Maybe I am missing some fundemantal DBus knowledge, but I'm stumped. </p>
  
  <p>I also checked out this excellent answer: <a href="https://stackoverflow.com/questions/20206376/how-do-i-extract-the-returned-data-from-qdbusmessage-in-a-qt-dbus-call">How do I extract the returned data from QDBusMessage in a Qt DBus call?</a> but I could not adapt it to parse a dict.</p>
  
  <p>Would anyone know how to get to the last nested QVariant?</p>