Skip to content

SlideAnimation

Qt Base Class: QPropertyAnimation

Signature: QPropertyAnimation(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None QPropertyAnimation(self, target: PySide6.QtCore.QObject, propertyName: Union[PySide6.QtCore.QByteArray, bytes], parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
PropertyAnimation
prettyqt.core.propertyanimation

⋔ Inheritance diagram

graph TD
  1473293656032["animations.SlideAnimation"]
  1473299825760["core.PropertyAnimation"]
  1473299835520["core.VariantAnimationMixin"]
  1473299791600["core.AbstractAnimationMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473289070624["QtCore.QPropertyAnimation"]
  1473289069648["QtCore.QVariantAnimation"]
  1473289055008["QtCore.QAbstractAnimation"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299825760 --> 1473293656032
  1473299835520 --> 1473299825760
  1473299791600 --> 1473299835520
  1473299815024 --> 1473299791600
  140713234304496 --> 1473299815024
  1473289070624 --> 1473299825760
  1473289069648 --> 1473289070624
  1473289055008 --> 1473289069648
  1473288842240 --> 1473289055008
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: PropertyAnimation

Source code in prettyqt\animations\slideanimation.py
class SlideAnimation(core.PropertyAnimation):
    ID = "slide"

    def __init__(
        self,
        parent: QtWidgets.QWidget,
        duration: int = 1000,
        start: tuple[int, int] | core.Point = (0, 0),
        end: tuple[int, int] | core.Point = (0, 0),
        easing: core.easingcurve.TypeStr = "in_out_sine",
    ):
        super().__init__(parent)
        self.set_easing(easing)
        self.set_start_value(start)
        self.set_end_value(end)
        self.setDuration(duration)

    def set_start_value(self, point: datatypes.PointType):
        offset = datatypes.to_point(point)
        pos = self.parent().geometry().topLeft()
        self.setStartValue(pos + offset)

    def set_end_value(self, point: datatypes.PointType):
        offset = datatypes.to_point(point)
        pos = self.parent().geometry().topLeft()
        self.setEndValue(pos + offset)

    def apply_to(self, obj: QtWidgets.QWidget | Callable):
        if isinstance(obj, QtWidgets.QWidget):
            obj = obj.pos
        super().apply_to(obj)

⌗ Property table

Qt Property Type Doc
objectName QString
state QAbstractAnimation::State
loopCount int
currentTime int
currentLoop int
direction QAbstractAnimation::Direction
duration int
startValue QVariant
endValue QVariant
currentValue QVariant
duration int
easingCurve QEasingCurve
propertyName QByteArray
targetObject QObject