Question

I have QSettings object in ini format.
When I write settings.beginGroup("GENERAL") in the ini file i see the following:
[%General]

Why does this happen?

Was it helpful?

Solution

Here is the answer:

The INI file format has severe restrictions on the syntax of a key. Qt works around this by using % as an escape character in keys. In addition, if you save a top-level setting (a key with no slashes in it, e.g., "someKey"), it will appear in the INI file's "General" section. To avoid overwriting other keys, if you save something using the a key such as "General/someKey", the key will be located in the "%General" section, not in the "General" section.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top