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 ee8a5f4917
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>
This commit is contained in:
parent
3a9aba287c
commit
76f9a768e8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user