summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qsettings.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-04-20 10:45:58 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-04-26 15:10:15 +0200
commit76f9a768e89351e8b0690cdf2889bc45441f9686 (patch)
treeee8f20fe5de982b8930262ff833f22339ff06a90 /src/corelib/io/qsettings.cpp
parent3a9aba287ce92f5250c1b68d0e2a39a5f25c031d (diff)
Correct documentation of INI format's loss of type information
Although it loses type information for numeric types, it does preserve the type of most other values. This amends commit ee8a5f4917d98a26f8dedd6802eac754d748b227 Pick-to: 6.3 6.2 5.15 Change-Id: Id4d0e11eabff1874869b940c05055e0bebef5963 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/io/qsettings.cpp')
-rw-r--r--src/corelib/io/qsettings.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 0c32345961..57b01ec66d 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -2111,8 +2111,10 @@ 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.
+ Note that INI files lose the distinction between numeric data and the
+ strings used to encode them, so values written as numbers shall be read back
+ as QString. The numeric value can be recovered using \l QString::toInt(), \l
+ QString::toDouble() and related functions.
The \l{tools/settingseditor}{Settings Editor} example lets you
experiment with different settings location and with fallbacks
@@ -2395,9 +2397,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. Note that type information
- is not preserved when reading settings from INI files;
- all values will be returned as QString.
+ \value IniFormat Store the settings in INI files. Note that INI files
+ lose the distinction between numeric data and the
+ strings used to encode them, so values written as
+ numbers shall be read back as QString.
\value InvalidFormat Special value returned by registerFormat().
\omitvalue CustomFormat1