qt - QSettings rewriting the .ini file, so not able to restore the values -


when using below code on linux sles 11 machine .ini file recreating reason not able restore settings.

same code working fine on windows machine.

prb: want have opened file list on start window, user can select quickly.

void window::saverecentfilelist() {     qsettings settings(m_settingspath, qsettings::nativeformat);     settings.setvalue("recentfiles/list", qvariant(m_recentfileslist)); }  void window::restorerecentfilelist() {     qsettings settings(m_settingspath, qsettings::nativeformat);     m_recentfileslist = settings.value("recentfiles/list").tostringlist(); } 

try using qsettings::iniformat instead of qsettings::nativeformat. on windows, should using qsettings::iniformat anyways specific ini file location. linux uses ini files native format settings storage, qsettings documentation suggests that:

on platforms, if want read ini file directly, can use qsettings constructor takes file name first argument , pass qsettings::iniformat second argument.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -