PDA

View Full Version : trying to understand qsettings ...



kerim
27th April 2011, 08:15
hello,
i have a general question about qsettings, hope someone can give me some insides (could not figure it out from docs):

i have written an application that uses qsettings to store application settings.
where does qt actually save these ? and how can one clear these without having to clear it from application side (lets say when the application is installed) ??

thnx.

FelixB
27th April 2011, 08:21
that is platform-specific. on windows, qsettings uses the registry.

kerim
27th April 2011, 09:11
ok thnx.

but how do i clear lets say the registry (or whatever on any OS) when i install or uninstall my application so that the settings state after this is untouched like a virgin:confused:
thnx.

kerim
27th April 2011, 15:35
anyone got some ideas about this???

i am just interested if my whole registry gets messed up because my qt application saves everything within my registry and i dont know how to get rid of these entries explicitely :confused:

thnx

john_god
28th April 2011, 09:50
Personnaly I have never used QSettings because I don't like the idea of writting more "garbage" to the registry. I prefer to use a QFile to read and write data, like a .ini file.

squidge
28th April 2011, 10:36
Personnaly I have never used QSettings because I don't like the idea of writting more "garbage" to the registry. I prefer to use a QFile to read and write data, like a .ini file.

So, kinda like using QSettings with the QSettings::IniFormat flag so it writes to a file instead of the registry?

wysota
28th April 2011, 10:52
anyone got some ideas about this???
If you want to do this outside your application then either use some installer facilities that allow manipulating the registry or find if you can call regedit from a script in a way that would allow you to delete registry keys. If that's not an option then write a simple program that will use QSettings and delete the branches your application created.[/QUOTE]


Personnaly I have never used QSettings because I don't like the idea of writting more "garbage" to the registry. I prefer to use a QFile to read and write data, like a .ini file.
You can use QSettings to write ini files on Windows as well.

john_god
28th April 2011, 13:30
Thank you guys, I didn't know that . Guess I should read the docs more often :p
I learned another thing today :)