Skip to content

ScrollerProperties

Qt Base Class: QScrollerProperties

Signature: QScrollerProperties(self) -> None QScrollerProperties(self, sp: PySide6.QtWidgets.QScrollerProperties) -> None

Base classes

Name Children Inherits
QScrollerProperties
PySide6.QtWidgets
QScrollerProperties(self) -> None

⋔ Inheritance diagram

graph TD
  1473296345680["widgets.ScrollerProperties"]
  1473290819424["QtWidgets.QScrollerProperties"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473290819424 --> 1473296345680
  1473291690208 --> 1473290819424
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QScrollerProperties

Stores the settings for a QScroller.

Source code in prettyqt\widgets\scrollerproperties.py
class ScrollerProperties(QtWidgets.QScrollerProperties):
    """Stores the settings for a QScroller."""

    def __getitem__(self, metric: ScrollmetricStr | mod.ScrollMetric):
        return self.get_scroll_metric(metric)

    def __setitem__(self, metric: ScrollmetricStr | mod.ScrollMetric, value: Any):
        self.set_scroll_metric(metric, value)

    def keys(self) -> ScrollmetricStr:
        return SCROLL_METRIC.keys()

    def __iter__(self) -> Iterator[ScrollmetricStr]:
        return iter(SCROLL_METRIC.keys())

    def set_scroll_metric(self, metric: ScrollmetricStr | mod.ScrollMetric, value: Any):
        """Set scroll metric.

        Args:
            metric: Scroll metric to set
            value: Value to set
        """
        self.setScrollMetric(SCROLL_METRIC.get_enum_value(metric), value)

    def get_scroll_metric(self, metric: ScrollmetricStr | mod.ScrollMetric) -> Any:
        """Return scroll metric.

        Args:
            metric: Scroll metric to get

        Returns:
            state
        """
        return self.scrollMetric(SCROLL_METRIC.get_enum_value(metric))

    def get_scroll_metrics(self) -> dict[ScrollmetricStr, Any]:
        return {i: self.get_scroll_metric(i) for i in SCROLL_METRIC}

get_scroll_metric(metric: ScrollmetricStr | mod.ScrollMetric) -> Any

Return scroll metric.

Parameters:

Name Type Description Default
metric ScrollmetricStr | ScrollMetric

Scroll metric to get

required
Source code in prettyqt\widgets\scrollerproperties.py
def get_scroll_metric(self, metric: ScrollmetricStr | mod.ScrollMetric) -> Any:
    """Return scroll metric.

    Args:
        metric: Scroll metric to get

    Returns:
        state
    """
    return self.scrollMetric(SCROLL_METRIC.get_enum_value(metric))

set_scroll_metric(metric: ScrollmetricStr | mod.ScrollMetric, value: Any)

Set scroll metric.

Parameters:

Name Type Description Default
metric ScrollmetricStr | ScrollMetric

Scroll metric to set

required
value Any

Value to set

required
Source code in prettyqt\widgets\scrollerproperties.py
def set_scroll_metric(self, metric: ScrollmetricStr | mod.ScrollMetric, value: Any):
    """Set scroll metric.

    Args:
        metric: Scroll metric to set
        value: Value to set
    """
    self.setScrollMetric(SCROLL_METRIC.get_enum_value(metric), value)