Qt3DAnimation::QAbstractClipAnimator Class
class Qt3DAnimation::QAbstractClipAnimatorQAbstractClipAnimator 是提供动画播放功能的类型的基类。更多内容...
| 头文件: | #include <qabstractclipanimator.h> |
| CMake: | 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) |
通知器信号:
| 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()
停止动画。
© 2026 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.