PDA

View Full Version : How to store some settings without database but with sort of delete protection?



Terreox
16th February 2012, 18:28
Hi there
i would like to know if there is a good way to store some application settings? They have to be available even after restarting the program. So maybe i have to store an ID of something.
If i add 1 to ID (ID is 0) then i have to be able to get ID=1 after restarting the application.
I heard about QSettings but is it something that will suit my requirements?

Edit: If QSettings is the right way will all stored values be still available after copying the application to another pc?



Greetz

KillGabio
16th February 2012, 19:39
you are talking about the editor settings? like color identing etc?

wysota
16th February 2012, 19:39
QSettings on Windows by default stores data in the registry, so transferring the application to a different machine will not transfer the settings. However QSettings can also store settings in files in which case moving the file to the other machine will make the settings available there.

Terreox
16th February 2012, 19:42
@KillGabio:
No i mean some variables like GUI Settings (e.g. geometry of your GUI)

@wysota:
Thanks will try it out