Qt 5.9 | Qt 3D | C++ Classes | QAbstractAnimation

Qt 5.9.3 Reference Documentation

# QAbstractAnimation Class

(Qt3DAnimation::QAbstractAnimation)

An abstract base class for Qt3D animations More...

Header: | #include <QAbstractAnimation>
qmake: | QT += 3danimation
Since: | Qt 5.9
Instantiated By: | AbstractAnimation
Inherits: | QObject

- List of all members, including inherited members

## Public Types

enum | AnimationType { KeyframeAnimation, MorphingAnimation, VertexBlendAnimation }

## Properties

- animationName : QString
- animationType : const QAbstractAnimation::AnimationType
- duration : const float
- position : float

- 1 property inherited from QObject

## Public Functions

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

- 32 public functions inherited from QObject

## Public Slots

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

- 1 public slot inherited from QObject

## Signals

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

- 2 signals inherited from QObject

## Protected Functions

| QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = nullptr)
void | setDuration(float duration)

- 9 protected functions inherited from QObject

### Additional Inherited Members

- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

An abstract base class for Qt3D animations

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

Constant | Value | Description
--- | --- | ---
`Qt3DAnimation::QAbstractAnimation::KeyframeAnimation` | `1` | Simple keyframe animation implementation for QTransform
`Qt3DAnimation::QAbstractAnimation::MorphingAnimation` | `2` | Blend-shape morphing animation
`Qt3DAnimation::QAbstractAnimation::VertexBlendAnimation` | `3` | Vertex-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)

### animationType : const QAbstractAnimation::AnimationType

Holds the type of the animation.

Access functions:

QAbstractAnimation::AnimationType | animationType() const

### 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]` QAbstractAnimation::QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = nullptr)

Copy constructor.

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

Sets the duration of the animation.

See also duration().