diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-02-20 13:17:51 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-02-20 17:51:18 +0000 |
commit | ee8a5f4917d98a26f8dedd6802eac754d748b227 (patch) | |
tree | 7524c5669065dd3584f1885a019338a3eddb142a /src/corelib/io/qsettings.cpp | |
parent | 130bede6196ba32cc7fcbd7773c7732045f0d80c (diff) |
Document that type information is lost when reading QSettings from INI
This is quite an important detail for an otherwise useful format. We
should make the user aware that they currently have a tradeoff:
- Either you can store settings in one place on all platforms that your
application targets and have to manually manage conversion from
strings, or
- Use native formats which can be hard to find and edit, but retain
type information.
Change-Id: Ic648524c9ebff25246d7cdefb7628ff5ddf84964
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Diffstat (limited to 'src/corelib/io/qsettings.cpp')
-rw-r--r-- | src/corelib/io/qsettings.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 0d2bd72d75..ed61c4aca0 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2167,6 +2167,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \snippet settings/settings.cpp 15 + Note that type information is not preserved when reading settings from INI + files; all values will be returned as QString. + The \l{tools/settingseditor}{Settings Editor} example lets you experiment with different settings location and with fallbacks turned on or off. @@ -2448,7 +2451,10 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, On 32-bit Windows or from a 64-bit application on 64-bit Windows, this works the same as specifying NativeFormat. This enum value was added in Qt 5.7. - \value IniFormat Store the settings in INI files. + \value IniFormat Store the settings in INI files. Note that type information + is not preserved when reading settings from INI files; + all values will be returned as QString. + \value InvalidFormat Special value returned by registerFormat(). \omitvalue CustomFormat1 \omitvalue CustomFormat2 |