Solved qsetting array
-
@sandycoolxyz That explains the behaviour you described.
But it doesn't tell anything about /home - is it on its own partition?
For global configuration you can use /opt/etc
"Own data can be stored anywhere else in directory /opt." - you should check the access rights there. -
My bad, I forgot about the version you are using. Then it would be QDesktopService::storageLocation.
On a side note, if you are locked to Qt 4, please consider 4.8.7 which is the latest and last version of the Qt 4 series.
-
QSettings settings("/opt/example.ini",QSettings::IniFormat); settings.beginWriteArray("arrayvalue"); settings.setArrayIndex(index); settings.setValue("id",value); settings.endArray(); settings.sync(); QProcess::execute( "/bin/sync" );
I tried lot of things and this seems to work. But I did not understand why exactly.
Anyways thanks for you support. -
Likely it depends on how your power cycled your device while testing your application.
If you just pushed some reset button, then then was no synchronisation done hence the data weren't written on the flash memory.
Disk write are not instantaneous, especially on such devices where there's a limit on how many times you can write on a given chip before blocks start to die. So you have to either gracefully restart your system or use sync like you did before going further. But beware, you should avoid triggering useless write on your flash memory.