QSettings how to save QMap<QString,int> into configuration file
-
wrote on 31 Jul 2011, 08:41 last edited by
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
-
wrote on 31 Jul 2011, 08:58 last edited by
Write them with
@
foreach (const QString &key;, map.keys()) {
settings.setValue(key, map[key]);
}
@
and read them back with
@
QStringList QSettings::allKeys () const
@ -
wrote on 31 Jul 2011, 09:41 last edited by
There's a nonclosed bold tag somewhere...
-
wrote on 31 Jul 2011, 09:45 last edited by
peppe, yeah, it happens sometimes and fyi there is no bold tag in first post source. Marius or Gurudutt should look here.
-
wrote on 31 Jul 2011, 10:10 last edited by
Why is all text bold?
-
wrote on 31 Jul 2011, 10:51 last edited by
The thread's title is not HTML-escaped. Thus the <> symbols in the template break things.
-
wrote on 31 Jul 2011, 12:56 last edited by
[quote author="peppe" date="1312109506"]The thread's title is not HTML-escaped. Thus the <> symbols in the template break things.[/quote]
That was the problem, I replaced the tags by the HTML escape sequences now...
1/7