QKeyframeAnimation#
A class implementing simple keyframe animation to a QTransform. More…
Synopsis#
Properties#
Functions#
def
addKeyframe
(keyframe)def
easing
()def
endMode
()def
framePositions
()def
keyframeList
()def
removeKeyframe
(keyframe)def
setKeyframes
(keyframes)def
startMode
()def
target
()def
targetName
()
Slots#
def
setEasing
(easing)def
setEndMode
(mode)def
setFramePositions
(positions)def
setStartMode
(mode)def
setTarget
(target)def
setTargetName
(name)
Signals#
def
easingChanged
(easing)def
endModeChanged
(endMode)def
framePositionsChanged
(positions)def
startModeChanged
(startMode)def
targetChanged
(target)def
targetNameChanged
(name)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
A QKeyframeAnimation
class implements simple keyframe animation that can be used to animate QTransform. The keyframes consists of multiple timed QTransforms, which are interpolated and applied to the target QTransform. QEasingCurve is used between keyframes to control the interpolator. RepeatMode
can be set for when the position set to the QKeyframeAnimation
is below or above the values defined in the keyframe positions.
- class PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Constructs an QKeyframeAnimation
with parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.easing: PySide6.QtCore.QEasingCurve#
Holds the easing curve of the interpolator between keyframes.
- Access functions:
easing
()setEasing
(easing)Signal
easingChanged
(easing)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.endMode: RepeatMode#
Holds the repeat mode for the position values greater than the last frame position.
- Access functions:
endMode
()setEndMode
(mode)Signal
endModeChanged
(endMode)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.framePositions: list of float#
Holds the positions of the keyframes. Each position in the list specifies the position of the corresponding keyframe with the same index. The values must be in an ascending order. Values can be positive or negative and do not have any predefined unit.
- Access functions:
setFramePositions
(positions)Signal
framePositionsChanged
(positions)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.startMode: RepeatMode#
Holds the repeat mode for the position values less than the first frame position.
- Access functions:
startMode
()setStartMode
(mode)Signal
startModeChanged
(startMode)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.target: PySide6.Qt3DCore.Qt3DCore.QTransform#
Holds the target QTransform the animation is applied to.
- Access functions:
target
()setTarget
(target)Signal
targetChanged
(target)
- property PᅟySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetName: str#
Holds the name of the target transform. This is a convenience property making it easier to match the target transform to the keyframe animation. The name is usually same as the name of the parent entity of the target transform, but does not have to be.
- Access functions:
targetName
()setTargetName
(name)Signal
targetNameChanged
(name)
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.RepeatMode#
This enumeration specifies how position values outside keyframe values are handled.
Constant
Description
Qt3DAnimation.QKeyframeAnimation.None
The animation is not applied to the target transform.
Qt3DAnimation.QKeyframeAnimation.Constant
The edge keyframe value is used.
Qt3DAnimation.QKeyframeAnimation.Repeat
The animation is repeated.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.addKeyframe(keyframe)#
- Parameters:
keyframe –
PySide6.Qt3DCore.Qt3DCore.QTransform
Adds new keyframe
at the end of the animation. The QTransform can be added to the animation multiple times.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.easing()#
- Return type:
See also
Getter of property easing
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.easingChanged(easing)#
- Parameters:
easing –
PySide6.QtCore.QEasingCurve
Notification signal of property easing
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.endMode()#
- Return type:
See also
Getter of property endMode
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.endModeChanged(endMode)#
- Parameters:
endMode –
RepeatMode
Notification signal of property endMode
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.framePositions()#
- Return type:
.list of float
See also
Getter of property framePositions
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.framePositionsChanged(positions)#
- Parameters:
positions – .list of float
Notification signal of property framePositions
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.keyframeList()#
- Return type:
.list of Qt3DCore.QTransform
Returns the list of keyframes.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.removeKeyframe(keyframe)#
- Parameters:
keyframe –
PySide6.Qt3DCore.Qt3DCore.QTransform
Removes a keyframe
from the animation. If the same QTransform is set as keyframe multiple times, all occurrences are removed.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setEasing(easing)#
- Parameters:
easing –
PySide6.QtCore.QEasingCurve
See also
Setter of property easing
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setEndMode(mode)#
- Parameters:
mode –
RepeatMode
See also
Setter of property endMode
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setFramePositions(positions)#
- Parameters:
positions – .list of float
See also
Setter of property framePositions
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setKeyframes(keyframes)#
- Parameters:
keyframes – .list of Qt3DCore.QTransform
Sets the keyframes
of the animation. Old keyframes are cleared.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setStartMode(mode)#
- Parameters:
mode –
RepeatMode
See also
Setter of property startMode
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setTarget(target)#
- Parameters:
target –
PySide6.Qt3DCore.Qt3DCore.QTransform
See also
Setter of property target
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setTargetName(name)#
- Parameters:
name – str
See also
Setter of property targetName
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.startMode()#
- Return type:
See also
Getter of property startMode
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.startModeChanged(startMode)#
- Parameters:
startMode –
RepeatMode
Notification signal of property startMode
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.target()#
- Return type:
See also
Getter of property target
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetChanged(target)#
- Parameters:
target –
PySide6.Qt3DCore.Qt3DCore.QTransform
Notification signal of property target
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetName()#
- Return type:
str
See also
Getter of property targetName
.
- PySide6.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetNameChanged(name)#
- Parameters:
name – str
Notification signal of property targetName
.