Qt3DAnimation::QAbstractClipAnimator Class
class Qt3DAnimation::QAbstractClipAnimatorQAbstractClipAnimator 是提供动画播放功能类型的基类。更多
头文件: | #include <QAbstractClipAnimator> |
CMake.QAbstractClipAnimator | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
qmake: | QT += 3danimation |
在 QML 中: | AbstractClipAnimator |
继承: | Qt3DCore::QComponent |
继承于 | Qt3DAnimation::QBlendedClipAnimator 和Qt3DAnimation::QClipAnimator |
状态: | 已废弃 |
公共类型
enum | Loops { Infinite } |
属性
|
|
公共功能
Qt3DAnimation::QChannelMapper * | channelMapper() const |
Qt3DAnimation::QClock * | clock() const |
bool | isRunning() const |
int | loopCount() const |
float | normalizedTime() const |
公共插槽
void | setChannelMapper(Qt3DAnimation::QChannelMapper *channelMapper) |
void | setClock(Qt3DAnimation::QClock *clock) |
void | setLoopCount(int loops) |
void | setNormalizedTime(float timeFraction) |
void | setRunning(bool running) |
void | start() |
void | stop() |
信号
void | channelMapperChanged(Qt3DAnimation::QChannelMapper *channelMapper) |
void | clockChanged(Qt3DAnimation::QClock *clock) |
void | loopCountChanged(int loops) |
void | normalizedTimeChanged(float index) |
void | runningChanged(bool running) |
详细说明
QAbstractClipAnimator 的子类可由 QEntity 聚合,以提供动画功能。动画组件提供了一个控制动画(如启动、停止)的接口。每种动画器类型都需要某种形式的动画数据,如QAbstractAnimationClip 以及QChannelMapper ,后者描述了如何将动画片段中的通道映射到希望制作动画的对象属性上。
可使用以下子类:
成员类型文档
enum QAbstractClipAnimator::Loops
动画播放的次数。
常数 | 值 | 说明 |
---|---|---|
Qt3DAnimation::QAbstractClipAnimator::Infinite | -1 | 此值将不断重复循环播放动画,直到明确停止为止。 |
属性文档
channelMapper : Qt3DAnimation::QChannelMapper*
此属性包含通道映射器(ChannelMapper),用于控制动画片段中的通道如何映射到目标对象的属性上。
访问功能
Qt3DAnimation::QChannelMapper * | channelMapper() const |
void | setChannelMapper(Qt3DAnimation::QChannelMapper *channelMapper) |
通知信号
void | channelMapperChanged(Qt3DAnimation::QChannelMapper *channelMapper) |
clock : Qt3DAnimation::QClock*
时钟控制动画的播放速度。
访问功能
Qt3DAnimation::QClock * | clock() const |
void | setClock(Qt3DAnimation::QClock *clock) |
通知信号
void | clockChanged(Qt3DAnimation::QClock *clock) |
loops : int
动画播放的次数。
默认值为 1:动画播放一次后停止。
如果设置为QAbstractClipAnimator::Infinite ,动画将不断重复播放,直到明确停止。
访问功能:
int | loopCount() const |
void | setLoopCount(int loops) |
通知信号:
void | loopCountChanged(int loops) |
normalizedTime : float
该属性保存剪辑的归一化时间。
访问功能:
float | normalizedTime() const |
void | setNormalizedTime(float timeFraction) |
通知信号:
void | normalizedTimeChanged(float index) |
running : bool
该属性包含一个布尔值,表示动画当前是否正在运行。
访问功能:
bool | isRunning() const |
void | setRunning(bool running) |
Notifier 信号:
void | runningChanged(bool running) |
成员函数 文档
bool QAbstractClipAnimator::isRunning() const
返回一个布尔值,表示动画当前是否正在运行。
注: 属性running 的获取函数。
int QAbstractClipAnimator::loopCount() const
返回动画播放的次数。
默认值为 1:动画播放一次后停止。
如果设置为QAbstractClipAnimator::Infinite ,动画将不断重复播放,直到明确停止。
注: 属性loops 的获取函数。
另请参阅 setLoopCount() 。
[slot]
void QAbstractClipAnimator::start()
启动动画。
[slot]
void QAbstractClipAnimator::stop()
停止动画。
© 2025 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.