QCallbackMapping Classclass Qt3DAnimation::QCallbackMapping
Allows to map the channels within the clip onto an invocation of a callback object. More...
|qmake:||QT += 3danimation|
|void||setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, QAnimationCallback::Flags flags = QAnimationCallback::OnOwningThread)|
|void||setChannelName(const QString &channelName)|
Member Function Documentation
void QCallbackMapping::setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, 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, 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.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.