Skip to content

StyleOptionSlider

Qt Base Class: QStyleOptionSlider

Signature: QStyleOptionSlider(self) -> None QStyleOptionSlider(self, other: PySide6.QtWidgets.QStyleOptionSlider) -> None QStyleOptionSlider(self, version: int) -> None

Base classes

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

⋔ Inheritance diagram

graph TD
  1473296196352["widgets.StyleOptionSlider"]
  1473296178784["widgets.StyleOptionComplexMixin"]
  1473296150480["widgets.StyleOptionMixin"]
  140713234304496["builtins.object"]
  1473365827488["QtWidgets.QStyleOptionSlider"]
  1473365836272["QtWidgets.QStyleOptionComplex"]
  1473365411984["QtWidgets.QStyleOption"]
  1473291690208["Shiboken.Object"]
  1473296178784 --> 1473296196352
  1473296150480 --> 1473296178784
  140713234304496 --> 1473296150480
  1473365827488 --> 1473296196352
  1473365836272 --> 1473365827488
  1473365411984 --> 1473365836272
  1473291690208 --> 1473365411984
  140713234304496 --> 1473291690208

🛈 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