[Qt-interest] Data Storage for QT Application

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Tue Feb 9 16:41:52 CET 2010


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 
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list