在本页中

添加状态间的转换

要使状态之间的移动平滑,可以使用Transitions 为状态之间的变化制作动画。

首先,您需要在States 视图中添加状态,并在Properties 视图中编辑一些可以制作动画的属性,如颜色或数字。例如,您可以将组件位置的变化制作成动画。

过渡视图

Transitions 中,您可以设置每个属性过渡的起始帧、结束帧和持续时间。还可以为每个动画设置缓和曲线和整个过渡的最长持续时间。

放大过渡效果

Transitions 中使用工具栏上的滑块设置缩放级别。选择缩小按钮放大按钮 按钮放大或缩小视图。

为状态之间的过渡设置动画

要制作过渡动画,请

  1. 选择View >Views >Transitions

    一个空的过渡视图。

  2. 选择加号按钮 (Add Transition) 添加过渡。只有在添加了至少一个状态并修改了其中至少一个属性后,此操作才会生效。

    过渡视图

  3. 移动组件或属性名称旁边的蓝色条,设置属性动画的开始和结束帧。拉动其左右边缘可设置动画的持续时间。
  4. 要为选定的过渡附加缓和曲线,请选择曲线编辑器按钮 (Easing Curve Editor (C)) 按钮。

指定过渡设置

要修改过渡设置,请在Transitions 中选择首选项 "按钮 (Transition Settings (S)) 。

过渡设置。

要添加过渡效果:

  1. 选择加号按钮 (Add Transition)。
  2. Transition ID 中,输入过渡的 ID。
  3. From 中,选择要从哪个状态过渡。
  4. To 中,选择要过渡到的状态。

要删除当前过渡,请选择减号按钮 (Remove Transition) 按钮。

要更改状态组,请从State Group 中选择。

另请参阅 如何:添加动画Qt Quick UI 设计设计Qt Quick UI

Copyright © The Qt Company Ltd. and other contributors. 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.