QSettings how to save QMap<QString,int> into configuration file
-
currently im saving simple values into configuration file , but now i have QMap<QString ,int>
struct that i like to map into configuration file.
so if my QMap look like this:
"11111",1
"22222",1
"4444,0
in my configuration it will look like this:[my gui config]
11111=1
22222=1
4444=0and also how to ready it back to the same QMap struct
-
Write them with
@
foreach (const QString &key;, map.keys()) {
settings.setValue(key, map[key]);
}
@
and read them back with
@
QStringList QSettings::allKeys () const
@ -
peppe, yeah, it happens sometimes and fyi there is no bold tag in first post source. Marius or Gurudutt should look here.