-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.6
With OSX Yosemite QSettings::setValue(name, value) doesn't store the proper settings value.
Code snippet:
const float myValue = 1.2f; const float defaultValue = 0.1f; QSettings settings( QSettings::UserScope, "QtCompany", "PreferencesTest" ); settings.beginGroup( "/Preferences" ); settings.setValue( "/My value", myValue ); float myValueReadFromMemory = settings.value( "/My value", defaultValue ).toFloat(); settings.endGroup(); settings.sync(); QSettings settingsToRead( QSettings::UserScope, "QtCompany", "PreferencesTest" ); settingsToRead.beginGroup( "/Preferences" ); float myValueRead = settingsToRead.value( "/My value", defaultValue ).toFloat(); settingsToRead.endGroup(); printf( "value %f default %f read %f read(from memory) %f\n", myValue, defaultValue, myValueRead, myValueReadFromMemory );
Outputs:
On Mavericks: value 1.200000 default 0.100000 read 1.200000 read(from memory) 1.200000 On Yosemite: value 1.200000 default 0.100000 read 0.000000 read(from memory) 0.000000