Qt 5.11 | Qt 3D | C++ Classes | QCallbackMapping

Qt 5.11.3 Reference Documentation

# QCallbackMapping Class

(Qt3DAnimation::QCallbackMapping)

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

Header: | #include <QCallbackMapping>
qmake: | QT += 3danimation
Inherits: | Qt3DAnimation::QAbstractChannelMapping

- List of all members, including inherited members

## Properties

- channelName : QString

- 3 properties inherited from Qt3DCore::QNode

## Public Functions

| QCallbackMapping(Qt3DCore::QNode *parent = nullptr)
virtual | ~QCallbackMapping()
Qt3DAnimation::QAnimationCallback * | callback() const
QString | channelName() const
void | setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, QAnimationCallback::Flags flags)

- 13 public functions inherited from Qt3DCore::QNode

## Public Slots

void | setChannelName(const QString &channelName)

- 3 public slots inherited from Qt3DCore::QNode

## Signals

void | channelNameChanged(QString channelName)

- 4 signals inherited from Qt3DCore::QNode

## Protected Functions

| QCallbackMapping(Qt3DAnimation::QCallbackMappingPrivate &dd, Qt3DCore::QNode *parent = nullptr)

- 2 protected functions inherited from Qt3DCore::QNode

## Detailed Description

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

## Property Documentation

### channelName : QString

Access functions:

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

Notifier signal:

void | channelNameChanged(QString channelName)

## Member Function Documentation

### QCallbackMapping::QCallbackMapping(Qt3DCore::QNode *parent = nullptr)

Default constructs an instance of QCallbackMapping.

### `[protected]` QCallbackMapping::QCallbackMapping(Qt3DAnimation::QCallbackMappingPrivate &dd, Qt3DCore::QNode *parent = nullptr)

Default constructs an instance of QCallbackMapping.

### `[virtual]` QCallbackMapping::~QCallbackMapping()

Destroys the instance of QCallbackMapping. The destructor is virtual.

### Qt3DAnimation::QAnimationCallback *QCallbackMapping::callback() const

See also setCallback().

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

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 onValueChanged() 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, QVariant::Vector3D, QVariant::Color, 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.

See also callback().