Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QSettings adds percent symbol to the group name

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?

like image 600
Funt Avatar asked Dec 05 '25 15:12

Funt


1 Answers

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.

like image 134
Funt Avatar answered Dec 09 '25 05:12

Funt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!