AnimationController QML Type
启用动画的手动控制。更多...
| Import Statement: | import QtQuick |
属性
方法
- void completeToBeginning()
- void completeToEnd()
- void reload()
详细说明
通常,动画由内部计时器驱动,但 AnimationController 允许通过显式设置progress 的值来驱动指定的animation 。
属性文档
animation : Animation [default]
该属性用于存储由AnimationController 控制的动画。
注意:由AnimationController 控制的动画,其running 和paused 属性始终被设置为true。该动画无法手动启动或停止(这与“Behavior”中的动画无法手动启动或停止的情况类似)。
progress : real
该属性用于存储动画进度值。
progress 的有效取值范围为0.0至1.0,小于0的值将被转换为0,大于1的值将被转换为1。
方法文档
void completeToBeginning()
结束受控动画的逆向播放。
调用此方法后,动画将从当前进度点开始,以倒序方式正常运行至起始状态。
在动画运行期间,动画控制器的进度值将自动更新。
另请参阅 completeToEnd() 和progress 。
void completeToEnd()
结束受控动画的正向播放。
调用此方法后,动画将从当前进度点开始,按正常方式向前播放至结束状态。
在动画运行期间,动画控制器的进度值将自动更新。
另请参阅 completeToBeginning() 和progress 。
void reload()
重新加载动画属性
如果动画属性发生了变化,请调用此方法以重新加载动画定义。
© 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.