Hi community,
I need to serialize a vector of multi maps to a data stream and read it back.

I did this to write it:

Qt Code:
  1. // Retrieve the model from mainwindow
  2. SelectedListModel *model = reinterpret_cast<SelectedListModel*>(ui->selectedItemsView->model());
  3. // Get the reports data
  4. QVector<QMultiMap<QString, QString>> reports = model->reports();
  5.  
  6. QFile fileData(m_configPath + QDir::separator() + "file.dat");
  7. fileData.open(QIODevice::WriteOnly);
  8. QDataStream outData(&fileData);
  9. for (int idx = 0; idx < reports.size(); idx++)
  10. {
  11. // ... more code ...
  12. outData << reports[idx];
  13. }
  14.  
  15. fileData.flush();
  16. fileData.close();
To copy to clipboard, switch view to plain text mode 

Now I have some problem in reading it back from the file.
When I try to read it, it does not read the full data.

Qt Code:
  1. QFile fileData(m_configPath + QDir::separator() + "file.dat");
  2. fileData.open(QIODevice::ReadOnly);
  3.  
  4. QDataStream in(&fileData);
  5. QMultiMap<QString, QString> mmap;
  6. in >> mmap;
  7.  
  8. qDebug() << mmap;
To copy to clipboard, switch view to plain text mode 

Can I have a help?
Regards