Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to clear the value of a QSettings
SamFaye last edited by
I use this statement to invalidate the value of a QSettings @mySettings.value ("code"). Clear ();@
But when I do @if (! mySettings.value ("code"). IsValid ())@ it returns true
How can I do?
Jupiter last edited by
i think you have to call sync() in between. that forces the settings to be written on disk. and you call 2 different setting values that might also be the problem :)
goetz last edited by
mySettings.value() returns a QVariant. So you clear the contents of the returned variant, not the settings.
You should try:
This removes the key and its value from the QSettings object. A sync() is not necessary.