
Originally Posted by
ivareske
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:
device >> map;
return true;
}
device << map;
return true;
}
bool readFile(QIODevice &device, QSettings::SettingsMap &map) {
QDataStream stream(&device);
device >> map;
return true;
}
bool writeFile(QIODevice &device, const QSettings::SettingsMap &map) {
QDataStream stream(&device);
device << map;
return true;
}
To copy to clipboard, switch view to plain text mode
Bookmarks