QSettings/Doc: fix the information about what's case-sensitive and not
The docs didn't match the implementation. Fixes: QTBUG-40283 Pick-to: 6.9 6.8 Change-Id: I054a22409aa8b2d198b0fffd6346b9859c55681a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
9e61bd2465
commit
0de9b3f126
@ -2009,10 +2009,13 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
|
|||||||
|
|
||||||
\section1 Section and Key Syntax
|
\section1 Section and Key Syntax
|
||||||
|
|
||||||
Setting keys can contain any Unicode characters. The Windows
|
Setting keys can contain any Unicode characters. The file format and
|
||||||
registry and INI files use case-insensitive keys, whereas the
|
operating system will determine if they are sensitive to case or not. On
|
||||||
CFPreferences API on \macos and iOS uses case-sensitive keys. To
|
Windows, the registry and INI files will use case-insensitive keys, while
|
||||||
avoid portability problems, follow these simple rules:
|
user-specified formats registered with registerFormat() may be either. On
|
||||||
|
Unix systems, keys are always case-sensitive.
|
||||||
|
|
||||||
|
To avoid portability problems, follow these simple rules:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Always refer to the same key using the same case. For example,
|
\li Always refer to the same key using the same case. For example,
|
||||||
@ -3174,10 +3177,11 @@ bool QSettings::isWritable() const
|
|||||||
Sets the value of setting \a key to \a value. If the \a key already
|
Sets the value of setting \a key to \a value. If the \a key already
|
||||||
exists, the previous value is overwritten.
|
exists, the previous value is overwritten.
|
||||||
|
|
||||||
Note that the Windows registry and INI files use case-insensitive
|
//! [key-case-sensitivity]
|
||||||
keys, whereas the CFPreferences API on \macos and iOS uses
|
Key lookup will either be sensitive or insensitive to case depending on
|
||||||
case-sensitive keys. To avoid portability problems, see the
|
file format and operating system. To avoid portability problems, see the
|
||||||
\l{Section and Key Syntax} rules.
|
\l{Section and Key Syntax} rules.
|
||||||
|
//! [key-case-sensitivity]
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@ -3215,10 +3219,7 @@ void QSettings::setValue(QAnyStringView key, const QVariant &value)
|
|||||||
|
|
||||||
\snippet code/src_corelib_io_qsettings.cpp 25
|
\snippet code/src_corelib_io_qsettings.cpp 25
|
||||||
|
|
||||||
Note that the Windows registry and INI files use case-insensitive
|
\include qsettings.cpp key-case-sensitivity
|
||||||
keys, whereas the CFPreferences API on \macos and iOS uses
|
|
||||||
case-sensitive keys. To avoid portability problems, see the
|
|
||||||
\l{Section and Key Syntax} rules.
|
|
||||||
|
|
||||||
\note In Qt versions prior to 6.4, this function took QString, not
|
\note In Qt versions prior to 6.4, this function took QString, not
|
||||||
QAnyStringView.
|
QAnyStringView.
|
||||||
@ -3253,10 +3254,7 @@ void QSettings::remove(QAnyStringView key)
|
|||||||
If a group is set using beginGroup(), \a key is taken to be
|
If a group is set using beginGroup(), \a key is taken to be
|
||||||
relative to that group.
|
relative to that group.
|
||||||
|
|
||||||
Note that the Windows registry and INI files use case-insensitive
|
\include qsettings.cpp key-case-sensitivity
|
||||||
keys, whereas the CFPreferences API on \macos and iOS uses
|
|
||||||
case-sensitive keys. To avoid portability problems, see the
|
|
||||||
\l{Section and Key Syntax} rules.
|
|
||||||
|
|
||||||
\note In Qt versions prior to 6.4, this function took QString, not
|
\note In Qt versions prior to 6.4, this function took QString, not
|
||||||
QAnyStringView.
|
QAnyStringView.
|
||||||
@ -3320,10 +3318,7 @@ bool QSettings::event(QEvent *event)
|
|||||||
If no default value is specified, a default QVariant is
|
If no default value is specified, a default QVariant is
|
||||||
returned.
|
returned.
|
||||||
|
|
||||||
Note that the Windows registry and INI files use case-insensitive
|
\include qsettings.cpp key-case-sensitivity
|
||||||
keys, whereas the CFPreferences API on \macos and iOS uses
|
|
||||||
case-sensitive keys. To avoid portability problems, see the
|
|
||||||
\l{Section and Key Syntax} rules.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@ -3483,9 +3478,10 @@ void QSettings::setPath(Format format, Scope scope, const QString &path)
|
|||||||
QIODevice parameter to the read and write functions is always
|
QIODevice parameter to the read and write functions is always
|
||||||
opened in binary mode (i.e., without the \l QIODeviceBase::Text flag).
|
opened in binary mode (i.e., without the \l QIODeviceBase::Text flag).
|
||||||
|
|
||||||
The \a caseSensitivity parameter specifies whether keys are case
|
The \a caseSensitivity parameter specifies whether keys are case-sensitive
|
||||||
sensitive or not. This makes a difference when looking up values
|
or not. This makes a difference when looking up values using QSettings. The
|
||||||
using QSettings. The default is case sensitive.
|
default is case-sensitive. The parameter must be \c{Qt::CaseSensitive} on
|
||||||
|
Unix systems.
|
||||||
|
|
||||||
By default, if you use one of the constructors that work in terms
|
By default, if you use one of the constructors that work in terms
|
||||||
of an organization name and an application name, the file system
|
of an organization name and an application name, the file system
|
||||||
|
Loading…
x
Reference in New Issue
Block a user