QAbstractAnimation Class

class Qt3DAnimation::QAbstractAnimation

An abstract base class for Qt3D animations. More...

Header: #include <QAbstractAnimation>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
Instantiated By: AbstractAnimation
Inherits: QObject
Inherited By:

Qt3DAnimation::QKeyframeAnimation, Qt3DAnimation::QMorphingAnimation, and Qt3DAnimation::QVertexBlendAnimation

Public Types

enum AnimationType { KeyframeAnimation, MorphingAnimation, VertexBlendAnimation }

Properties

Public Functions

QString animationName() const
Qt3DAnimation::QAbstractAnimation::AnimationType animationType() const
float duration() const
float position() const

Public Slots

void setAnimationName(const QString &name)
void setPosition(float position)

Signals

void animationNameChanged(const QString &name)
void durationChanged(float duration)
void positionChanged(float position)

Protected Functions

void setDuration(float duration)

Detailed Description

Qt3DAnimation::QAbstractAnimation is an abstract base class for all animations. Qt3DAnimation::QAbstractAnimation can not be directly instantiated, but rather through its subclasses. QAbstractAnimation specifies common properties for all Qt3D animations, such as animation name and type, current position and animation duration, while leaving the actual animating for the subclasses.

Member Type Documentation

enum QAbstractAnimation::AnimationType

This enumeration specifies the type of the animation

ConstantValueDescription
Qt3DAnimation::QAbstractAnimation::KeyframeAnimation1Simple keyframe animation implementation for QTransform
Qt3DAnimation::QAbstractAnimation::MorphingAnimation2Blend-shape morphing animation
Qt3DAnimation::QAbstractAnimation::VertexBlendAnimation3Vertex-blend animation

Property Documentation

animationName : QString

Holds the name of the animation.

Access functions:

QString animationName() const
void setAnimationName(const QString &name)

Notifier signal:

void animationNameChanged(const QString &name)

[read-only] animationType : const AnimationType

Holds the type of the animation.

Access functions:

Qt3DAnimation::QAbstractAnimation::AnimationType animationType() const

[read-only] duration : const float

Holds the duration of the animation.

Access functions:

float duration() const

Notifier signal:

void durationChanged(float duration)

position : float

Holds the current position of the animation.

Access functions:

float position() const
void setPosition(float position)

Notifier signal:

void positionChanged(float position)

Member Function Documentation

[protected] void QAbstractAnimation::setDuration(float duration)

Sets the duration of the animation.

See also duration().

© 2024 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.