Skip to content

Settings

Qt Base Class: QSettings

Signature: QSettings(self, fileName: str, format: PySide6.QtCore.QSettings.Format, parent: Optional[PySide6.QtCore.QObject] = None) -> None QSettings(self, format: PySide6.QtCore.QSettings.Format, scope: PySide6.QtCore.QSettings.Scope, organization: str, application: str = '', parent: Optional[PySide6.QtCore.QObject] = None) -> None QSettings(self, organization: str, application: str = '', parent: Optional[PySide6.QtCore.QObject] = None) -> None QSettings(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None QSettings(self, scope: PySide6.QtCore.QSettings.Scope, organization: str, application: str = '', parent: Optional[PySide6.QtCore.QObject] = None) -> None QSettings(self, scope: PySide6.QtCore.QSettings.Scope, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
Settings_
prettyqt.core.settings
Persistent platform-independent application settings.

⋔ Inheritance diagram

graph TD
  1473299875536["core.Settings"]
  1473299869680["core.Settings_"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473288876400["QtCore.QSettings"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473222543776["abc.MutableMapping"]
  1473222540848["abc.Mapping"]
  1473222211728["abc.Collection"]
  1473222226368["abc.Sized"]
  1473222223440["abc.Iterable"]
  1473222220512["abc.Container"]
  1473299869680 --> 1473299875536
  1473299815024 --> 1473299869680
  140713234304496 --> 1473299815024
  1473288876400 --> 1473299869680
  1473288842240 --> 1473288876400
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473222543776 --> 1473299869680
  1473222540848 --> 1473222543776
  1473222211728 --> 1473222540848
  1473222226368 --> 1473222211728
  140713234304496 --> 1473222226368
  1473222223440 --> 1473222211728
  140713234304496 --> 1473222223440
  1473222220512 --> 1473222211728
  140713234304496 --> 1473222220512

🛈 DocStrings

Bases: Settings_

Settings class which wraps everything into a dict to preserve data types.

Source code in prettyqt\core\settings.py
class Settings(Settings_):
    """Settings class which wraps everything into a dict to preserve data types."""

    def set_value(self, key: str, value):
        match value:
            case Settings_():
                setting = dict(value=dict(value), typ="subsetting")
            case _:
                setting = dict(value=value, typ="regular")
        super().set_value(key, setting)

    def get_value(self, key: str, default=None):
        if not self.contains(key):
            return default
        val = self.value(key)
        # TODO: convert settings dicts back?
        match val:
            case {"value": setting}:
                return setting
            case _:
                # this is for migration
                self.set_value(key, val)
                return val

⌗ Property table

Qt Property Type Doc
objectName QString