Skip to content

EasingCurve

Qt Base Class: QEasingCurve

Signature: QEasingCurve(self, other: Union[PySide6.QtCore.QEasingCurve, PySide6.QtCore.QEasingCurve.Type]) -> None QEasingCurve(self, type: PySide6.QtCore.QEasingCurve.Type = Instance(PySide6.QtCore.QEasingCurve.Type.Linear)) -> None

Base classes

Name Children Inherits
SerializeMixin
prettyqt.utils.serializemixin
QEasingCurve
PySide6.QtCore
QEasingCurve(self, other: Union[PySide6.QtCore.QEasingCurve, PySide6.QtCore.QEasingCurve.Type]) -> None

⋔ Inheritance diagram

graph TD
  1473299799408["core.EasingCurve"]
  1473299806240["utils.SerializeMixin"]
  140713234304496["builtins.object"]
  1473288959360["QtCore.QEasingCurve"]
  1473291690208["Shiboken.Object"]
  1473299806240 --> 1473299799408
  140713234304496 --> 1473299806240
  1473288959360 --> 1473299799408
  1473291690208 --> 1473288959360
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: SerializeMixin, QEasingCurve

Easing curves for controlling animation.

Source code in prettyqt\core\easingcurve.py
class EasingCurve(serializemixin.SerializeMixin, QtCore.QEasingCurve):
    """Easing curves for controlling animation."""

    def __init__(self, other_or_type: TypeStr | int | QtCore.QEasingCurve = "linear"):
        if isinstance(other_or_type, str) and other_or_type in TYPE:
            typ = TYPE[other_or_type]
        else:
            typ = other_or_type
        super().__init__(typ)

    def __getitem__(self, value: float) -> float:
        return self.valueForProgress(value)

    def __repr__(self):
        return get_repr(self, self.get_type())

    def set_custom_type(self, method: CurveMethod):
        self.setCustomType(method)

    def get_custom_type(self) -> CurveMethod:
        return self.customType()  # type: ignore

    def set_type(self, typ: TypeStr | QtCore.QEasingCurve.Type):
        """Set easing curve type.

        Args:
            typ: easing curve type
        """
        self.setType(TYPE.get_enum_value(typ))

    def get_type(self) -> TypeStr:
        """Get the current easing curve type.

        Returns:
            easing curve type
        """
        return TYPE.inverse[self.type()]

get_type() -> TypeStr

Get the current easing curve type.

Source code in prettyqt\core\easingcurve.py
def get_type(self) -> TypeStr:
    """Get the current easing curve type.

    Returns:
        easing curve type
    """
    return TYPE.inverse[self.type()]

set_type(typ: TypeStr | QtCore.QEasingCurve.Type)

Set easing curve type.

Parameters:

Name Type Description Default
typ TypeStr | Type

easing curve type

required
Source code in prettyqt\core\easingcurve.py
def set_type(self, typ: TypeStr | QtCore.QEasingCurve.Type):
    """Set easing curve type.

    Args:
        typ: easing curve type
    """
    self.setType(TYPE.get_enum_value(typ))