QKeyframeAnimation¶
A class implementing simple keyframe animation to a
QTransform. More…

Synopsis¶
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)
Detailed Description¶
A
QKeyframeAnimationclass implements simple keyframe animation that can be used to animateQTransform. The keyframes consists of multiple timed QTransforms, which are interpolated and applied to the targetQTransform.QEasingCurveis used between keyframes to control the interpolator.RepeatModecan be set for when the position set to theQKeyframeAnimationis below or above the values defined in the keyframe positions.
- class PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation([parent=None])¶
- param parent:
Constructs an
QKeyframeAnimationwithparent.
- PySide2.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.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.addKeyframe(keyframe)¶
- Parameters:
keyframe –
PySide2.Qt3DCore.Qt3DCore.QTransform
Adds new
keyframeat the end of the animation. TheQTransformcan be added to the animation multiple times.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.easing()¶
- Return type:
Holds the easing curve of the interpolator between keyframes.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.easingChanged(easing)¶
- Parameters:
easing –
PySide2.QtCore.QEasingCurve
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.endMode()¶
- Return type:
Holds the repeat mode for the position values greater than the last frame position.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.endModeChanged(endMode)¶
- Parameters:
endMode –
RepeatMode
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.framePositions()¶
- Return type:
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.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.framePositionsChanged(positions)¶
- Parameters:
positions –
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.keyframeList()¶
- Return type:
Returns the list of keyframes.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.removeKeyframe(keyframe)¶
- Parameters:
keyframe –
PySide2.Qt3DCore.Qt3DCore.QTransform
Removes a
keyframefrom the animation. If the sameQTransformis set as keyframe multiple times, all occurrences are removed.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setEasing(easing)¶
- Parameters:
easing –
PySide2.QtCore.QEasingCurve
Holds the easing curve of the interpolator between keyframes.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setEndMode(mode)¶
- Parameters:
mode –
RepeatMode
Holds the repeat mode for the position values greater than the last frame position.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setFramePositions(positions)¶
- Parameters:
positions –
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.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setKeyframes(keyframes)¶
- Parameters:
keyframes –
Sets the
keyframesof the animation. Old keyframes are cleared.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setStartMode(mode)¶
- Parameters:
mode –
RepeatMode
Holds the repeat mode for the position values less than the first frame position.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setTarget(target)¶
- Parameters:
target –
PySide2.Qt3DCore.Qt3DCore.QTransform
Holds the target
QTransformthe animation is applied to.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.setTargetName(name)¶
- Parameters:
name – 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.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.startMode()¶
- Return type:
Holds the repeat mode for the position values less than the first frame position.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.startModeChanged(startMode)¶
- Parameters:
startMode –
RepeatMode
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.target()¶
- Return type:
Holds the target
QTransformthe animation is applied to.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetChanged(target)¶
- Parameters:
target –
PySide2.Qt3DCore.Qt3DCore.QTransform
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetName()¶
- Return type:
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.
- PySide2.Qt3DAnimation.Qt3DAnimation.QKeyframeAnimation.targetNameChanged(name)¶
- Parameters:
name – str
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.