QAnimationGroup Class | Qt 3D 5.12.6

Qt 5.12 | Qt 3D | C++ Classes | QAnimationGroup

Qt 5.12.6 Reference Documentation

# QAnimationGroup Class

(Qt3DAnimation::QAnimationGroup)

A class grouping animations together. More...

Header: | #include <QAnimationGroup>
qmake: | QT += 3danimation
Since: | Qt 5.9
Inherits: | QObject

- List of all members, including inherited members
- Obsolete members

## Properties

- duration : const float
- name : QString
- position : float

- 1 property inherited from QObject

## Public Functions

| QAnimationGroup(QObject *parent = nullptr)
void | addAnimation(Qt3DAnimation::QAbstractAnimation *animation)
QVector<Qt3DAnimation::QAbstractAnimation *> | animationList()
float | duration() const
QString | name() const
float | position() const
void | removeAnimation(Qt3DAnimation::QAbstractAnimation *animation)
void | setAnimations(const QVector<Qt3DAnimation::QAbstractAnimation *> &animations)

- 31 public functions inherited from QObject

## Public Slots

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

- 1 public slot inherited from QObject

## Signals

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

- 2 signals inherited from QObject

## Static Public Members

const QMetaObject | staticMetaObject

- 9 static public members inherited from QObject

### Additional Inherited Members

- 9 protected functions inherited from QObject

## Detailed Description

A class grouping animations together.

Qt3DAnimation::QAnimationGroup class is used to group multiple animations so that they can act as one animation. The position set to the group is also set to all animations in a group. The duration is the maximum of the individual animations. The animations can be any supported animation type and do not have to have the same name.

## Property Documentation

### duration : const float

Holds the maximum duration of the animations in the group.

Access functions:

float | duration() const

Notifier signal:

void | durationChanged(float duration)

### name : QString

Holds the name of the animation group.

Access functions:

QString | name() const
void | setName(const QString &name)

Notifier signal:

void | nameChanged(const QString &name)

### position : float

Holds the animation position.

Access functions:

float | position() const
void | setPosition(float position)

Notifier signal:

void | positionChanged(float position)

## Member Function Documentation

### QAnimationGroup::QAnimationGroup(QObject *parent = nullptr)

Constructs an QAnimationGroup with parent.

### void QAnimationGroup::addAnimation(Qt3DAnimation::QAbstractAnimation *animation)

Adds new animation to the group.

### QVector<Qt3DAnimation::QAbstractAnimation *> QAnimationGroup::animationList()

Returns the list of animations in the group.

### void QAnimationGroup::removeAnimation(Qt3DAnimation::QAbstractAnimation *animation)

Removes animation from the group.

### void QAnimationGroup::setAnimations(const QVector<Qt3DAnimation::QAbstractAnimation *> &animations)

Sets the animations to the group. Old animations are removed.