[Qt-interest] How do I remove " " from a QSettings

David Boosalis david.boosalis at gmail.com
Sat Jun 19 22:35:14 CEST 2010


Thank you for the reply Andreas.

I first tried to ignore the double quotes QSettings put into the ini file. I
simply would write it out to a  file with the double quotes and then read in
the file a line at a time and strip them out.  Then I noticed that QSettings
was setting a backward slash to a forward slash (or was it vise versa).
Here I gave up on QSettings for writting ini files and just wrote them out
myself



On Fri, Jun 18, 2010 at 11:42 AM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 18.06.10 10:07:30, David Boosalis wrote:
> > I am converting an old TKL code to QT.  The new Qt code needs to write
> ini
> > files that are backward compatible to the old software.  One major
> > difference is that QSettings.value(str) write out double quotes.  I'd
> like
> > to get rid of the double quotes.
> >
> > For example one line of output is:
> >            SpiceModel = "$*38,38"
> >
> > I'd like to have QSettings not write with double quotes around the value
>
> Looking at Qt's source code (iniEscapedString) the problem is the comma in
> your example above. [,;= ] and empty strings cause that function to write
> out quotes. If you can't avoid the comma and other characters, then you'll
> have to write (or copy Qt's) own ini-parser.
>
> Andreas
>
> --
> You recoil from the crude; you tend naturally toward the exquisite.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100619/bdf407a6/attachment.html 


More information about the Qt-interest-old mailing list