[Qt-interest] no comma for string type value in an INI format file?
Markus Goetz
Markus.Goetz at nokia.com
Mon Oct 19 09:35:24 CEST 2009
You have already answered the question for yourself.
It seems like the way a saving of a string is done in QSettings is by
putting it inside quotation marks.
Without the quotation marks, the comma separated values are seen as a
list. (I have not checked this, just a guess)
Markus
ext Yan Jiangguo (James) wrote:
> QSettings also handles correctly, if i change mystr to :
>
> mystr = "0,1,2,3"
>
> in INI file.
>
> On Mon, Oct 19, 2009 at 4:13 AM, Yan Jiangguo (James)
> <jyan972 at gmail.com <mailto:jyan972 at gmail.com>> wrote:
>
> p.s. i'm sure it's OK if i use native windows API to handle it.
>
>
> On Mon, Oct 19, 2009 at 4:13 AM, Yan Jiangguo (James)
> <jyan972 at gmail.com <mailto:jyan972 at gmail.com>> wrote:
>
> hey all,
>
> I have an INI file like this one:
> [mykey]
> mystr = 0,1,2,3,
>
> then i try to read the string in with QSetttings :
> QString mystr = qset.value("mykey/mystr").toString();
> but, the result of mystr is ""
>
> if i change the mystr in INI file like this one:
> mystr = 0123
>
> then mystr will "0123" correctly after reading with
> QSetttings, what's wrong with it, no comma in INI file for
> string type value?
>
>
>
More information about the Qt-interest-old
mailing list