Norman0406 / LISA-old

Old repository for the first LISA attempt. Development is continued in https://github.com/Norman0406/LISA
GNU General Public License v3.0
1 stars 0 forks source link

Settings #1

Open Norman0406 opened 11 years ago

Norman0406 commented 11 years ago
semaph0r commented 11 years ago

I think QSettings is not type-safe because it uses a simple key-value storage mechanism where <QString, QString> or <QString, QInt> will be stored.

As mentioned in the documentation, you will retrieve an QVariant object. And that's the point - this can be literally anything :(

Norman0406 commented 11 years ago

I would like to provide a type safe form of storing settings in files, that's why I implemented a custom settings concept which stores value as well as type informaton. However, I noticed QVariant does provide type checking using QVariant::type(). When implementing a custom storage format using QSettings::registerFormat, it might be possible to store type information as well and provide a type safe approach to writing settings to XML.