config¶
Module Contents¶
Theme enumeration |
|
Config validator |
|
Range validator |
|
Options validator |
|
Boolean validator |
|
Folder validator |
|
Folder list validator |
|
RGB color validator |
|
Config serializer |
|
enumeration class serializer |
|
QColor serializer |
|
Config item |
|
Config item of range |
|
Config item with options |
|
Color config item |
|
Config of app |
whether the theme is dark mode |
|
|
get theme mode |
- ALERT = Multiline-String¶
Show Value
""" [1;33m📢 Tips:[0m QFluentWidgets Pro is now released. Click [1;96mhttps://qfluentwidgets.com/pages/pro[0m to learn more about it. """
- class ConfigValidator¶
Config validator
- validate(value)¶
Verify whether the value is legal
- correct(value)¶
correct illegal value
- class RangeValidator(min, max)¶
Bases:
ConfigValidator
Range validator
- validate(value)¶
Verify whether the value is legal
- correct(value)¶
correct illegal value
- class OptionsValidator(options)¶
Bases:
ConfigValidator
Options validator
- validate(value)¶
Verify whether the value is legal
- correct(value)¶
correct illegal value
- class BoolValidator¶
Bases:
OptionsValidator
Boolean validator
- class FolderValidator¶
Bases:
ConfigValidator
Folder validator
- validate(value)¶
Verify whether the value is legal
- correct(value)¶
correct illegal value
- class FolderListValidator¶
Bases:
ConfigValidator
Folder list validator
- validate(value)¶
Verify whether the value is legal
- correct(value: List[str])¶
correct illegal value
- class ColorValidator(default)¶
Bases:
ConfigValidator
RGB color validator
- validate(color)¶
Verify whether the value is legal
- correct(value)¶
correct illegal value
- class ConfigSerializer¶
Config serializer
- serialize(value)¶
serialize config value
- deserialize(value)¶
deserialize config from config file’s value
- class EnumSerializer(enumClass)¶
Bases:
ConfigSerializer
enumeration class serializer
- serialize(value)¶
serialize config value
- deserialize(value)¶
deserialize config from config file’s value
- class ColorSerializer¶
Bases:
ConfigSerializer
QColor serializer
- serialize(value: PyQt5.QtGui.QColor)¶
serialize config value
- deserialize(value)¶
deserialize config from config file’s value
- class ConfigItem(group, name, default, validator=None, serializer=None, restart=False)¶
Bases:
PyQt5.QtCore.QObject
Config item
- property value¶
get the value of config item
- property key¶
get the config key separated by .
- valueChanged¶
- __str__()¶
- serialize()¶
- deserializeFrom(value)¶
- class RangeConfigItem(group, name, default, validator=None, serializer=None, restart=False)¶
Bases:
ConfigItem
Config item of range
- property range¶
get the available range of config
- __str__()¶
- class OptionsConfigItem(group, name, default, validator=None, serializer=None, restart=False)¶
Bases:
ConfigItem
Config item with options
- property options¶
- __str__()¶
- class ColorConfigItem(group, name, default, restart=False)¶
Bases:
ConfigItem
Color config item
- __str__()¶
- class QConfig¶
Bases:
PyQt5.QtCore.QObject
Config of app
- property theme¶
get theme mode, can be Theme.Light or Theme.Dark
- appRestartSig¶
- themeChanged¶
- themeChangedFinished¶
- themeColorChanged¶
- themeMode¶
- themeColor¶
- get(item)¶
get the value of config item
- set(item, value, save=True, copy=True)¶
set the value of config item
Parameters¶
- item: ConfigItem
config item
- value:
the new value of config item
- save: bool
whether to save the change to config file
- copy: bool
whether to deep copy the new value
- toDict(serialize=True)¶
convert config items to dict
- save()¶
save config
- qconfig¶
- isDarkTheme()¶
whether the theme is dark mode
- theme()¶
get theme mode