ScaleAnimator QML Type
ScaleAnimator 类型用于动画显示项目的缩放因子。更多
Import Statement: | import QtQuick |
Inherits: |
详细说明
Animator 类型不同于普通的动画类型。使用 Animator 时,动画可以在呈现线程中运行,当动画完成时,属性值将跳转到末尾。
Item::scale 的值会在动画结束后更新。
下面的代码段展示了如何将 ScaleAnimator 与矩形项结合使用。
Rectangle { id: scalingBox width: 50 height: 50 color: "lightsteelblue" ScaleAnimator { target: scalingBox; from: 0.5; to: 1; duration: 1000 running: true } }
也可以使用on
关键字将 ScaleAnimator 直接绑定到项目实例上。
Rectangle { width: 50 height: 50 color: "lightsteelblue" ScaleAnimator on scale { from: 0.5; to: 1; duration: 1000 } }
© 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.