Skip to content

StandardPaths

Qt Base Class: QStandardPaths

Signature: None

Base classes

Name Children Inherits
QStandardPaths
PySide6.QtCore

⋔ Inheritance diagram

🛈 DocStrings

Bases: QStandardPaths

Methods for accessing standard paths.

Source code in prettyqt\core\standardpaths.py
class StandardPaths(QtCore.QStandardPaths):
    """Methods for accessing standard paths."""

    @classmethod
    def get_display_name(cls, location: StandardLocationStr) -> str:
        return cls.displayName(STANDARD_LOCATION[location])

    @classmethod
    def get_writable_location(cls, location: StandardLocationStr) -> pathlib.Path | None:
        path = cls.writableLocation(STANDARD_LOCATION[location])
        return pathlib.Path(path) if path else None

    @classmethod
    def get_standard_locations(cls, location: StandardLocationStr) -> list[pathlib.Path]:
        paths = cls.standardLocations(STANDARD_LOCATION[location])
        return [pathlib.Path(p) for p in paths]