Quote Originally Posted by ivareske View Post
When using ini files, does anyone know how QSettings transforms say a QStringList (or any other object) into the text that is written to the ini file?
Qt is open-source. The easiest way is to look at the code responsible for this.

But since you want to do mangle the data I don't see the point in duplicating what QSettings does for ini files. Just provide your own read and write functions that save to a custom format and do the encryption as part of the process. The simplest possible read/write combination is:
Qt Code:
  1. bool readFile(QIODevice &device, QSettings::SettingsMap &map) {
  2. QDataStream stream(&device);
  3. device >> map;
  4. return true;
  5. }
  6.  
  7. bool writeFile(QIODevice &device, const QSettings::SettingsMap &map) {
  8. QDataStream stream(&device);
  9. device << map;
  10. return true;
  11. }
To copy to clipboard, switch view to plain text mode