Hi,
I have problems reading a QMap value from QSettings. I write the data and it is written, but when I read it I get nothing.

I create settings file like this:

Qt Code:
  1. settings=new QSettings("identities.conf",QSettings::IniFormat);
  2. QMap<QString, QVariant> imap;
  3. imap.insert("user1@gmail.com","John Smith");
  4. imap.insert("user2@gmail,com","Juan Perez");
  5. settings->setValue("identitites",imap);
To copy to clipboard, switch view to plain text mode 

Then I try to read it and I get an empty list, here is how I do it:
Qt Code:
  1. int size;
  2. QList <QString> ql;
  3. QMap<QString, QVariant> *imap_ptr;
  4. qv=settings->value("identities");
  5. qWarning() << "qv" << qv;
  6. imap_ptr=new QMap<QString,QVariant>(qv.toMap());
  7. qWarning() << "map:" << imap_ptr;
  8. qWarning() << "keys" << imap_ptr->keys();
  9. ql=imap_ptr->keys();
  10. size=ql.size();
  11. qWarning() << "list size=" << size;
To copy to clipboard, switch view to plain text mode 

The debug output is this:
Qt Code:
  1. qv QVariant(Invalid)
  2. map: 0x22f1eb0
  3. keys ()
  4. list size= 0
To copy to clipboard, switch view to plain text mode 

the settings file is not empty , I can see the data:
Qt Code:
  1. [niko@localhost build-forms-Desktop_Qt_5_2_1_GCC_64bit-Debug]$ cat identities.conf
  2. [General]
  3. identitites="@Variant(\0\0\0\b\0\0\0\x2\0\0\0\x1e\0u\0s\0\x65\0r\0\x32\0@\0g\0m\0\x61\0i\0l\0,\0\x63\0o\0m\0\0\0\n\0\0\0\x14\0J\0u\0\x61\0n\0 \0P\0\x65\0r\0\x65\0z\0\0\0\x1e\0u\0s\0\x65\0r\0\x31\0@\0g\0m\0\x61\0i\0l\0.\0\x63\0o\0m\0\0\0\n\0\0\0\x14\0J\0o\0h\0n\0 \0S\0m\0i\0t\0h)"
  4. [niko@localhost build-forms-Desktop_Qt_5_2_1_GCC_64bit-Debug]$
To copy to clipboard, switch view to plain text mode 

Probably, I am not using methods correcly, how would I read a QMap stored in settings file ?