- Qt 6.12
- Qt 3D
- C++ Classes
- Qt3DAnimation (Deprecated)
- QCallbackMapping
- Qt 6.12.0 Reference Documentation

# Qt3DAnimation::QCallbackMapping Class

class Qt3DAnimation::QCallbackMapping

Allows to map the channels within the clip onto an invocation of a callback object. More...

Header: | `#include <qcallbackmapping.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS 3danimation)` `target_link_libraries(mytarget PRIVATE Qt6::3danimation)`
qmake: | `QT += 3danimation`
Inherits: | Qt3DAnimation::QAbstractChannelMapping
Status: | Technology preview

This class is in technology preview and is subject to change.

- List of all members, including inherited members

## Properties

- channelName : QString

## Public Functions

QString | channelName() const
void | setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, Qt3DAnimation::QAnimationCallback::Flags flags = QAnimationCallback::OnOwningThread)

## Public Slots

void | setChannelName(const QString &channelName)

## Signals

void | channelNameChanged(QString channelName)

## Detailed Description

## Property Documentation

### channelName : QString

Holds the name of the channel for the callback mapping.

Access functions:

QString | channelName() const
void | setChannelName(const QString &channelName)

Notifier signal:

void | channelNameChanged(QString channelName)

## Member Function Documentation

### void QCallbackMapping::setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, Qt3DAnimation::QAnimationCallback::Flags flags = QAnimationCallback::OnOwningThread)

Associates a callback object with this channel mapping.

Such mappings do not have to have a target object and property name. When the callback object is set, every change in the animated value will lead to invoking the callback's valueChanged function either on the gui/main thread, or directly on one of the thread pool's worker thread. This is controlled by flags.

type specifies the type (for example, QMetaType::QVector3D, QMetaType::QColor, or QMetaType::Float) of the animated value. When animating node properties this does not need to be provided separately, however it becomes important to supply this when there is only a callback.

Note: A mapping can be associated both with a node property and a callback. It is important however that type matches the type of the property in this case. Note also that for properties of type QVariant (for example, QParameter::value), the type is the type of the value stored in the QVariant.

Note: The callback pointer is expected to stay valid while any associated animators are running.