How to stop QSettings by changing the order of the key = value pairs in the settings file?

In my program, I have a Microsoft INI style settings / configuration file that is created, edited and saved using a convenient class QSettings, but the user can manually edit this file using the program itself or any text editor that it wants geditor vim. The order in which key = value pairs appear is important. The problem is that whenever I try to save changes during shutdown, the order of the key = value pairs changes to random order, and it seems impossible to stop QSettingsfrom changing it. For explanation, here is an example configuration file:

[AlarmGroup1]
DateTimeNotInitialized=1
DateTimeStampError=2
ParametersMissingOrInconsistent=3
NotInitialized=4
FlashMemoryFatalError=5
NotIdentified=6

which changes to:

[AlarmGroup1]
ParametersMissingOrInconsistent=3
DateTimeNotInitialized=1
DateTimeStampError=2
NotInitialized=4
FlashMemoryFatalError=5
NotIdentified=6

? QSettings ?

+4
1

QSettings , , , , / /, .

, :

+1

All Articles