PDA

View Full Version : Problem with QSettings



arbi
24th September 2008, 06:51
hi,
i am trying to use QSettings for storing som config info.

i am using IniFormat with a specific path. I can't get my inifile created.

to simplify the case, i wrote the simplest code below. even that does not seem to work. This is so simple and I guess i am missing something. but what?


QSettings s("test.ini", QSettings::IniFormat);
int stat = s.status(); // this returns 0
s.setValue("someconfig","somevalue");
stat = s.status(); // this returns 0

after running the above code without errors , i am looking for "test.ini"
there is no such file.

is there something more i must add into my code?

thanks..

arbi
24th September 2008, 07:37
the problem somehow disappeared.. now it works although i dont know what i changed.

anyway. its gone.. :)

bleucanard
24th September 2008, 08:49
I don't think the ini file is saved until the object is destroyed or when you call QSettings::sync()

Pierre