PDA

View Full Version : How to Update in .ini file?



phillip_Qt
15th April 2008, 13:21
HI All.
I've a query.
I ve a push button. I want to set a flag as 1 in an .ini file.(let it be C:\test.ini) when i click push button 1st time. and if ill click this button again then set the flag 0.
Is it possible. ?
And how ll i read the flag value in another .cpp file?
Thank u all in advance.

mazurekwrc
15th April 2008, 13:40
to read value you can just open your ini file and use value method


QSettings settings( "test.ini", QSettings::IniFormat );
QString value = settings.value( "your_key" );


if you want to change value use setValue