Skip to content

StyleOptionSlider

Base classes

Name Children Inherits
StyleOptionComplexMixin
prettyqt.widgets.styleoptioncomplex
QStyleOptionSlider
PySide6.QtWidgets
QStyleOptionSlider(self, /) -> None

⋔ Inheritance diagram

graph TD
  2870589337["widgets.StyleOptionSlider"]
  1413797265["widgets.StyleOptionComplexMixin"]
  1301028405["widgets.StyleOptionMixin"]
  2751680898["builtins.object"]
  2977369431["QtWidgets.QStyleOptionSlider"]
  3095499432["QtWidgets.QStyleOptionComplex"]
  2562791995["QtWidgets.QStyleOption"]
  37984305["Shiboken.Object"]
  1413797265 --> 2870589337
  1301028405 --> 1413797265
  2751680898 --> 1301028405
  2751680898 --> 1413797265
  2977369431 --> 2870589337
  3095499432 --> 2977369431
  2562791995 --> 3095499432
  37984305 --> 2562791995
  2751680898 --> 37984305

🛈 DocStrings

Bases: StyleOptionComplexMixin, QStyleOptionSlider

Source code in prettyqt/widgets/styleoptionslider.py
class StyleOptionSlider(widgets.StyleOptionComplexMixin, widgets.QStyleOptionSlider):
    def is_horizontal(self) -> bool:
        """Check if silder is horizontal.

        Returns:
            True if horizontal, else False
        """
        return self.orientation == constants.HORIZONTAL

    def is_vertical(self) -> bool:
        """Check if silder is vertical.

        Returns:
            True if vertical, else False
        """
        return self.orientation == constants.VERTICAL

    def set_horizontal(self) -> None:
        """Set slider orientation to horizontal."""
        self.orientation = constants.HORIZONTAL

    def set_vertical(self) -> None:
        """Set slider orientation to vertical."""
        self.orientation = constants.VERTICAL

    def get_orientation(self) -> Literal["horizontal", "vertical"]:
        return "horizontal" if self.is_horizontal() else "vertical"

is_horizontal() -> bool

Check if silder is horizontal.

Source code in prettyqt/widgets/styleoptionslider.py
def is_horizontal(self) -> bool:
    """Check if silder is horizontal.

    Returns:
        True if horizontal, else False
    """
    return self.orientation == constants.HORIZONTAL

is_vertical() -> bool

Check if silder is vertical.

Source code in prettyqt/widgets/styleoptionslider.py
def is_vertical(self) -> bool:
    """Check if silder is vertical.

    Returns:
        True if vertical, else False
    """
    return self.orientation == constants.VERTICAL

set_horizontal() -> None

Set slider orientation to horizontal.

Source code in prettyqt/widgets/styleoptionslider.py
def set_horizontal(self) -> None:
    """Set slider orientation to horizontal."""
    self.orientation = constants.HORIZONTAL

set_vertical() -> None

Set slider orientation to vertical.

Source code in prettyqt/widgets/styleoptionslider.py
def set_vertical(self) -> None:
    """Set slider orientation to vertical."""
    self.orientation = constants.VERTICAL

:fa-brands-github: Show source on GitHub