Struct qt_core::q_settings::Format
source · pub struct Format(/* private fields */);
Expand description
This enum type specifies the storage format used by QSettings.
C++ enum: QSettings::Format
.
This enum type specifies the storage format used by QSettings.
On Unix, NativeFormat and IniFormat mean the same thing, except that the file extension is different (.conf
for NativeFormat, .ini
for IniFormat).
The INI file format is a Windows file format that Qt supports on all platforms. In the absence of an INI standard, we try to follow what Microsoft does, with the following exceptions:
- If you store types that QVariant can't convert to QString (e.g., QPoint, QRect, and QSize), Qt uses an
@
-based syntax to encode the type. For example:pos = @Point(100 100)
To minimize compatibility issues, any
@
that doesn't appear at the first position in the value or that isn't followed by a Qt type (Point
,Rect
,Size
, etc.) is treated as a normal character. - Although backslash is a special character in INI files, most Windows applications don't escape backslashes (
\
) in file paths:windir = C:\Windows
QSettings always treats backslash as a special character and provides no API for reading or writing such entries.
- The INI file format has severe restrictions on the syntax of a key. Qt works around this by using
%
as an escape character in keys. In addition, if you save a top-level setting (a key with no slashes in it, e.g., "someKey"), it will appear in the INI file's "General" section. To avoid overwriting other keys, if you save something using a key such as "General/someKey", the key will be located in the "%General" section, not in the "General" section. - Following the philosophy that we should be liberal in what we accept and conservative in what we generate, QSettings will accept Latin-1 encoded INI files, but generate pure ASCII files, where non-ASCII values are encoded using standard INI escape sequences. To make the INI files more readable (but potentially less compatible), call setIniCodec().
See also registerFormat() and setPath().
Implementations§
source§impl Format
impl Format
sourcepub const NativeFormat: Format = _
pub const NativeFormat: Format = _
Store the settings using the most appropriate storage format for the platform. On Windows, this means the system registry; on macOS and iOS, this means the CFPreferences API; on Unix, this means textual configuration files in INI format. (C++ enum variant: NativeFormat = 0
)
sourcepub const IniFormat: Format = _
pub const IniFormat: Format = _
Store the settings in INI files. (C++ enum variant: IniFormat = 1
)
sourcepub const InvalidFormat: Format = _
pub const InvalidFormat: Format = _
Special value returned by registerFormat(). (C++ enum variant: InvalidFormat = 16
)
sourcepub const CustomFormat1: Format = _
pub const CustomFormat1: Format = _
C++ enum variant: CustomFormat1 = 17
sourcepub const CustomFormat2: Format = _
pub const CustomFormat2: Format = _
C++ enum variant: CustomFormat2 = 18
sourcepub const CustomFormat3: Format = _
pub const CustomFormat3: Format = _
C++ enum variant: CustomFormat3 = 19
sourcepub const CustomFormat4: Format = _
pub const CustomFormat4: Format = _
C++ enum variant: CustomFormat4 = 20
sourcepub const CustomFormat5: Format = _
pub const CustomFormat5: Format = _
C++ enum variant: CustomFormat5 = 21
sourcepub const CustomFormat6: Format = _
pub const CustomFormat6: Format = _
C++ enum variant: CustomFormat6 = 22
sourcepub const CustomFormat7: Format = _
pub const CustomFormat7: Format = _
C++ enum variant: CustomFormat7 = 23
sourcepub const CustomFormat8: Format = _
pub const CustomFormat8: Format = _
C++ enum variant: CustomFormat8 = 24
sourcepub const CustomFormat9: Format = _
pub const CustomFormat9: Format = _
C++ enum variant: CustomFormat9 = 25
sourcepub const CustomFormat10: Format = _
pub const CustomFormat10: Format = _
C++ enum variant: CustomFormat10 = 26
sourcepub const CustomFormat11: Format = _
pub const CustomFormat11: Format = _
C++ enum variant: CustomFormat11 = 27
sourcepub const CustomFormat12: Format = _
pub const CustomFormat12: Format = _
C++ enum variant: CustomFormat12 = 28
sourcepub const CustomFormat13: Format = _
pub const CustomFormat13: Format = _
C++ enum variant: CustomFormat13 = 29
sourcepub const CustomFormat14: Format = _
pub const CustomFormat14: Format = _
C++ enum variant: CustomFormat14 = 30
sourcepub const CustomFormat15: Format = _
pub const CustomFormat15: Format = _
C++ enum variant: CustomFormat15 = 31
sourcepub const CustomFormat16: Format = _
pub const CustomFormat16: Format = _
C++ enum variant: CustomFormat16 = 32