Skip to content

CursorMoveAnimation

Qt Base Class: QVariantAnimation

Signature: QVariantAnimation(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
VariantAnimation
prettyqt.core.variantanimation

⋔ Inheritance diagram

graph TD
  1473293685312["animations.CursorMoveAnimation"]
  1473299837472["core.VariantAnimation"]
  1473299835520["core.VariantAnimationMixin"]
  1473299791600["core.AbstractAnimationMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473289069648["QtCore.QVariantAnimation"]
  1473289055008["QtCore.QAbstractAnimation"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299837472 --> 1473293685312
  1473299835520 --> 1473299837472
  1473299791600 --> 1473299835520
  1473299815024 --> 1473299791600
  140713234304496 --> 1473299815024
  1473289069648 --> 1473299837472
  1473289055008 --> 1473289069648
  1473288842240 --> 1473289055008
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: VariantAnimation

Animation to move mouse cursor. None for start / end uses current position.

Source code in prettyqt\animations\cursormoveanimation.py
class CursorMoveAnimation(core.VariantAnimation):
    """Animation to move mouse cursor. None for start / end uses current position."""

    def __init__(
        self,
        duration: int = 1000,
        start: datatypes.PointType | None = None,
        end: datatypes.PointType = (0, 0),
        easing: core.easingcurve.TypeStr = "in_out_sine",
        **kwargs,
    ):
        super().__init__(**kwargs)
        self.set_easing(easing)
        self.set_start_value(start)
        self.set_end_value(end)
        self.setDuration(duration)
        self.valueChanged.connect(gui.Cursor.setPos)

    def set_start_value(self, point: datatypes.PointType | None):
        """Set start position of mouse move."""
        point = gui.Cursor.pos() if point is None else datatypes.to_point(point)
        self.setStartValue(point)

    def set_end_value(self, point: datatypes.PointType | None):
        """Set start position of mouse move."""
        point = gui.Cursor.pos() if point is None else datatypes.to_point(point)
        self.setEndValue(point)

set_end_value(point: datatypes.PointType | None)

Set start position of mouse move.

Source code in prettyqt\animations\cursormoveanimation.py
def set_end_value(self, point: datatypes.PointType | None):
    """Set start position of mouse move."""
    point = gui.Cursor.pos() if point is None else datatypes.to_point(point)
    self.setEndValue(point)

set_start_value(point: datatypes.PointType | None)

Set start position of mouse move.

Source code in prettyqt\animations\cursormoveanimation.py
def set_start_value(self, point: datatypes.PointType | None):
    """Set start position of mouse move."""
    point = gui.Cursor.pos() if point is None else datatypes.to_point(point)
    self.setStartValue(point)

⌗ 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