QKeyframeAnimation Class
(Qt3DAnimation::QKeyframeAnimation)A class implementing simple keyframe animation to a QTransform 更多...
头文件: | #include <QKeyframeAnimation> |
qmake: | QT += 3danimation |
开始支持版本: | Qt 5.9 |
Instantiated By: | KeyframeAnimation |
基类: | QAbstractAnimation |
公有类型
enum | RepeatMode { None, Constant, Repeat } |
属性
|
|
- 6 个属性继承自 QAbstractAnimation
- 1 个属性继承自 QObject
公有函数
QKeyframeAnimation(QObject *parent = nullptr) | |
void | addKeyframe(Qt3DCore::QTransform *keyframe) |
QEasingCurve | easing() const |
RepeatMode | endMode() const |
QVector<float> | framePositions() const |
QVector<Qt3DCore::QTransform *> | keyframeList() const |
void | removeKeyframe(Qt3DCore::QTransform *keyframe) |
void | setKeyframes(const QVector<Qt3DCore::QTransform *> &keyframes) |
RepeatMode | startMode() const |
Qt3DCore::QTransform * | target() const |
QString | targetName() const |
- 11 个公有函数继承自 QAbstractAnimation
- 32 个公有函数继承自 QObject
公有槽函数
void | setEasing(const QEasingCurve &easing) |
void | setEndMode(RepeatMode mode) |
void | setFramePositions(const QVector<float> &positions) |
void | setStartMode(RepeatMode mode) |
void | setTarget(Qt3DCore::QTransform *target) |
void | setTargetName(const QString &name) |
- 6 个公有槽函数继承自 QAbstractAnimation
- 1 个公有槽函数继承自 QObject
信号
void | easingChanged(const QEasingCurve &easing) |
void | endModeChanged(QKeyframeAnimation::RepeatMode endMode) |
void | framePositionsChanged(const QVector<float> &positions) |
void | startModeChanged(QKeyframeAnimation::RepeatMode startMode) |
void | targetChanged(Qt3DCore::QTransform *target) |
void | targetNameChanged(const QString &name) |
- 4 个信号继承自 QAbstractAnimation
- 2 个信号继承自 QObject
其他继承的成员
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 4 个受保护的函数继承自 QAbstractAnimation
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
A class implementing simple keyframe animation to a QTransform
A Qt3DAnimation::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.
成员类型
enum QKeyframeAnimation::RepeatMode
This enumeration specifies how position values outside keyframe values are handled.
Constant | Value | Description |
---|---|---|
Qt3DAnimation::QKeyframeAnimation::None | 0 | The animation is not applied to the target transform. |
Qt3DAnimation::QKeyframeAnimation::Constant | 1 | The edge keyframe value is used. |
Qt3DAnimation::QKeyframeAnimation::Repeat | 2 | The animation is repeated. |
属性
easing : QEasingCurve
Holds the easing curve of the interpolator between keyframes.
访问函数:
QEasingCurve | easing() const |
void | setEasing(const QEasingCurve &easing) |
Notifier signal:
void | easingChanged(const QEasingCurve &easing) |
endMode : QKeyframeAnimation::RepeatMode
Holds the repeat mode for the position values greater than the last frame position.
访问函数:
RepeatMode | endMode() const |
void | setEndMode(RepeatMode mode) |
Notifier signal:
void | endModeChanged(QKeyframeAnimation::RepeatMode endMode) |
framePositions : QVector<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.
访问函数:
QVector<float> | framePositions() const |
void | setFramePositions(const QVector<float> &positions) |
Notifier signal:
void | framePositionsChanged(const QVector<float> &positions) |
startMode : QKeyframeAnimation::RepeatMode
Holds the repeat mode for the position values less than the first frame position.
访问函数:
RepeatMode | startMode() const |
void | setStartMode(RepeatMode mode) |
Notifier signal:
void | startModeChanged(QKeyframeAnimation::RepeatMode startMode) |
target : Qt3DCore::QTransform *
Holds the target QTransform the animation is applied to.
访问函数:
Qt3DCore::QTransform * | target() const |
void | setTarget(Qt3DCore::QTransform *target) |
Notifier signal:
void | targetChanged(Qt3DCore::QTransform *target) |
targetName : QString
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.
访问函数:
QString | targetName() const |
void | setTargetName(const QString &name) |
Notifier signal:
void | targetNameChanged(const QString &name) |
成员函数
QKeyframeAnimation::QKeyframeAnimation(QObject *parent = nullptr)
Constructs an QKeyframeAnimation with parent.
void QKeyframeAnimation::addKeyframe(Qt3DCore::QTransform *keyframe)
Adds new keyframe at the end of the animation. The QTransform can be added to the animation multiple times.
QVector<Qt3DCore::QTransform *> QKeyframeAnimation::keyframeList() const
Returns the list of keyframes.
void QKeyframeAnimation::removeKeyframe(Qt3DCore::QTransform *keyframe)
Removes a keyframe from the animation. If the same QTransform is set as keyframe multiple times, all occurrences are removed.
void QKeyframeAnimation::setKeyframes(const QVector<Qt3DCore::QTransform *> &keyframes)
Sets the keyframes of the animation. Old keyframes are cleared.