PDA

View Full Version : Where's the ini?



Atomic_Sheep
20th September 2017, 09:13
Hi,

I have the following code:


void MyClass::SetDefaultOptions()
{
QSettings Settings(QSettings::IniFormat, QSettings::UserScope, MyCompany", "MyApp");
Settings.setValue("options/dynamicresize", 1);
Settings.setValue("options/width", 480);
Settings.setValue("options/height", 800);
Settings.setValue("options/xcoordinate", 0);
Settings.setValue("options/ycoordinate", 0);
}

Which gets called in the constructor, but I can't find the ini when I run it. I'm guessing it's supposed to be in the debug/release folder?

ado130
20th September 2017, 11:08
You can define the filepath in the constructor: qsettings.html#QSettings-4

d_stranz
20th September 2017, 17:24
I'm guessing it's supposed to be in the debug/release folder?

Actually, try looking in your C:/Users/<username>/AppData/Local (or Roaming) folder for "MyCompany/MyApp.ini" on Windows.

Atomic_Sheep
21st September 2017, 11:33
Bingo, found it!

Thanks ado130 for the tip.