Hello,

i have problem with unmarshaling complex type from QDBusArgument. Method returns a{sa{sv}}. I declared typedef for this complex type:

Qt Code:
  1. typedef QMap<QString, QMap<QString, QVariant>> ConnectionSettings;
  2. Q_DECLARE_METATYPE(ConnectionSettings)
To copy to clipboard, switch view to plain text mode 

And i'm trying to call method:

Qt Code:
  1. ConnectionSettings NetworkConnection::getSettings()
  2. {
  3. QDBusInterface iface(m_serviceName, m_objectPath, m_interfaceName,
  4. SystemBusConnectionFactory::getInstance());
  5.  
  6. auto msg = iface.call("GetSettings");
  7. qDebug() << msg;
  8. auto retVal = msg.arguments()
  9. .first()
  10. .value<QDBusArgument>();
  11.  
  12. ConnectionSettings cs;
  13.  
  14. retVal.beginMap();
  15. while( !retVal.atEnd() ) {
  16. QString key;
  17. QVariantMap value;
  18. retVal.beginMapEntry();
  19. retVal >> key >> value; //This line crashes!
  20. retVal.endMapEntry();
  21. cs.insert(key, value);
  22. qDebug() << key << value;
  23. }
  24. retVal.endMap();
  25.  
  26. return cs;
  27. }
To copy to clipboard, switch view to plain text mode 

Unfortunately there is a segfault - debugger show line 331 in qdbusargument.h:

Qt Code:
  1. ...
  2. template<typename Key, typename T>
  3. inline const QDBusArgument &operator>>(const QDBusArgument &arg, QMap<Key, T> &map)
  4. {
  5. arg.beginMap();
  6. map.clear();
  7. while (!arg.atEnd()) {
  8. Key key;
  9. T value;
  10. arg.beginMapEntry(); // SIGSEGV here!
  11. arg >> key >> value;
  12. map.insertMulti(key, value);
  13. arg.endMapEntry();
  14. }
  15. arg.endMap();
  16. return arg;
  17. }
  18. ...
To copy to clipboard, switch view to plain text mode 

Where should I search for the problem?