[Qt-interest] QSettings (ini) Write and Load actions

Matthias Pospiech matthias.pospiech at gmx.de
Mon May 18 13:42:47 CEST 2009


Martin Hofius schrieb:
> Hello,
>
> Am Montag, 18. Mai 2009 schrieb Matthias Pospiech:
>   
>> I am using QSettings to write and load Applikation Data (mainly
>> calibration files) to an ini file.
>>
>> If construct the QSettings object each time I want to write or read
>> from/to the file. The filesize in total is 4 MB.
>> However I experience that each access takes very long.
>>     
> what kind of access? Creating the object or getting data from the created 
> object?
>   
Currently I create the object each time before I either load data or 
save data.
>> So my question is at which point the saving or reading takes place? At
>> the deconstruction of the QSettings object?
>> I am asking, because I am thinking of creating a global QSettings object
>> which is only deconstructed at quitting of the application.
>>     
> I doubt if creating ini files with a settings object is a performant way store 
> thousands of data sets (regarding your file size?). I suggest you to use 
> either a really flat data file or a database format (maybe sqlite)...
>
>   
It is surely not a performant way. But I want it to be all in a single 
file and I very much like the easy access that QSettings offers.
If I could switch QSettings from using a ini file to a sqlite file 
format I would do that, but converting all the code to a sql database, 
without me having any clue of SQL is not an option.

Matthais





More information about the Qt-interest-old mailing list