For the following code, in the destructor function of a class:
QSettings sets;
sets.setValue ("Category/Name", "abc");
Will the settings file get written again?
Or should I do this to reduce disk access:
if (sets.value ("Category/Name") != "abc")
sets.setValue (...);
Calling
QSettings::setValuewill force a write to the settings file even if the setting has not changed. As such, if you are trying to prevent writes to the settings file, your second approach is advisable.