C

QSafeAnimations Class

class SafeRenderer::QSafeAnimations

The QSafeAnimations class holds the animation data. More...

Header: #include <QSafeAnimations>
Since: QtSafeRenderer 1.2

This class was introduced in QtSafeRenderer 1.2.

Public Types

enum AnimationsException { IndexOutOfBounds, UnsupportedAnimationType, InvalidAnimationData }

Public Functions

QSafeAnimations()
~QSafeAnimations()
void addNew(const SafeRenderer::AnimationType typeArg, const SafeRenderer::quint32 targetArg, const SafeRenderer::quint32 fromArg, const SafeRenderer::quint32 toArg, const SafeRenderer::QSafeByteArray &animationDataArg)
void advance(const SafeRenderer::quint32 indexArg, SafeRenderer::QSafeLayout &layoutArg)
const SafeRenderer::AnimationData &animationAtIndex(const SafeRenderer::quint32 indexArg) const
SafeRenderer::quint32 countOfAnimations() const
void restart(const SafeRenderer::quint32 indexArg, SafeRenderer::QSafeLayout &layoutArg)

Detailed Description

The QSafeAnimations holds the data of animations in one layout item. Memory for the bitmap data is statically reserved. The maximum amount of the animations can be changed in qsafeconstraints.h. The variable is SafeRenderer::Constraints::MAX_NUM_OF_ANIMATIONS_PER_ITEM.

Member Type Documentation

enum QSafeAnimations::AnimationsException

This enum describes the exceptions of the animation.

ConstantValueDescription
SafeRenderer::QSafeAnimations::IndexOutOfBounds0The index is out of bounds.
SafeRenderer::QSafeAnimations::UnsupportedAnimationType1The type of the animation is not supported.
SafeRenderer::QSafeAnimations::InvalidAnimationData2The animation data is invalid.

Member Function Documentation

QSafeAnimations::QSafeAnimations()

Constructs a QSafeAnimations object.

QSafeAnimations::~QSafeAnimations()

Destructs a QSafeAnimations class

void QSafeAnimations::addNew(const SafeRenderer::AnimationType typeArg, const SafeRenderer::quint32 targetArg, const SafeRenderer::quint32 fromArg, const SafeRenderer::quint32 toArg, const SafeRenderer::QSafeByteArray &animationDataArg)

Adds a new animation with type typeArg. targetArg is the hash of the target item name. fromArg is the hash of the 'from' state name. toArg is the hash of the 'to' state name. animationDataArg is the byte array of the animation data.

void QSafeAnimations::advance(const SafeRenderer::quint32 indexArg, SafeRenderer::QSafeLayout &layoutArg)

Advances the animation one step in the index at indexArg. Changes the item property value in the layoutArg. If the indexArg is bigger than the count of the animations, SafeRenderer::QSafeAnimations::AnimationsException::IndexOutOfBounds exception is thrown.

const SafeRenderer::AnimationData &QSafeAnimations::animationAtIndex(const SafeRenderer::quint32 indexArg) const

Returns the reference to the AnimationData at the index indexArg. If the indexArg is bigger than the count of the animations, SafeRenderer::QSafeAnimations::AnimationsException::IndexOutOfBounds exception is thrown.

SafeRenderer::quint32 QSafeAnimations::countOfAnimations() const

Returns the count of the animations.

void QSafeAnimations::restart(const SafeRenderer::quint32 indexArg, SafeRenderer::QSafeLayout &layoutArg)

Restarts the animation in the index at indexArg. Resets the items property value to the default in the layoutArg. If the indexArg is bigger than the count of the animations, SafeRenderer::QSafeAnimations::AnimationsException::IndexOutOfBounds exception is thrown.

Available under certain Qt licenses.
Find out more.