QSettings file MIA
-
In using this code,
QSettings settings("MyCompany", "MyApp"); settings.beginGroup("AltGridColors"); settings.setValue("cust-alt-grid-color", color); settings.endGroup();I can't find a file in my project folder where this is being stored.
However, when I use this code,
QSettings* settings = new QSettings(QDir::currentPath() + "/MyApp.ini", QSettings::IniFormat); settings.beginGroup("General"); settings->setValue("test", "this"); settings.endGroup();I get an
.inifile, a file I can see in the project folder.Where is the code stored for the first use? Also, what does
settings->sync();do? -
In using this code,
QSettings settings("MyCompany", "MyApp"); settings.beginGroup("AltGridColors"); settings.setValue("cust-alt-grid-color", color); settings.endGroup();I can't find a file in my project folder where this is being stored.
However, when I use this code,
QSettings* settings = new QSettings(QDir::currentPath() + "/MyApp.ini", QSettings::IniFormat); settings.beginGroup("General"); settings->setValue("test", "this"); settings.endGroup();I get an
.inifile, a file I can see in the project folder.Where is the code stored for the first use? Also, what does
settings->sync();do?@Driftwood Did you read https://doc.qt.io/qt-5/qsettings.html ?
On Windows default location for settings is Windows Registry. -
-
@Driftwood Did you read https://doc.qt.io/qt-5/qsettings.html ?
On Windows default location for settings is Windows Registry.@jsulm said in QSettings file MIA:
@Driftwood Did you read https://doc.qt.io/qt-5/qsettings.html ?
On Windows default location for settings is Windows Registry.Just read the doc and see that QSettings defaults to
QSettings::NativeFormat, which uses the Windows registry, demonstrated in my first code block. And thensettings->sync()"imports changes made by other processes (in addition to writing the changes from this QSettings)."Note to self: Read first :D
@jsulm - Thank you.