[Qt-interest] Data Storage for QT Application
Sean Harmer
sean.harmer at maps-technology.com
Tue Feb 9 16:58:32 CET 2010
On Tuesday 09 February 2010 15:41:52 Oliver.Knoll at comit.ch wrote:
> Neville Dastur wrote on Tuesday, February 09, 2010 4:27 PM:
> >>> ...
> >>> my data is Country/Capital pair and number of entries can go upto
> >>> ...
> >>> Now with QSetting it always overwrite the key Country/Name with
> >>> ...
> >
> > I'm sorry but all this is a bit silly (not meant as a flame etc). SQL
> > seems like the man for the job.
>
> And if not SQL, why not writing into the good old QFile with Qt
> serialisation (http://doc.trolltech.com/4.6/qdatastream.html) instead of
> mis-using QSettings (yes, *settings*, which are meant to store application
> *settings* instead of data ;)?
>
> You can already write/read quite a lot of datatypes with a simple <<
> (respective >>) "out of the box":
> http://doc.trolltech.com/4.6/datastreamformat.html - including a QMap
> where you could store all your Country/Capital values.
>
> Cheers, Oliver
>
I agree. This is an abuse of QSettings but the OP seems to be unwilling to
learn the xml streamer classes or to use QFile, QTextStream and have a simple
csv type file.
Sean
More information about the Qt-interest-old
mailing list