State与Transition之Transition
来源:互联网 发布:远程教育软件哪家好 编辑:程序博客网 时间:2024/06/06 04:15
Transition 过渡
使用Transition使State状态变化时,消除状态变化产生的突变。
所有Item都有个transitions属性,它保存着所有的过渡,它是一个列表类型。
Properties
- animations : list< Animation >//动画列表,过渡使用的动画
- enabled : bool //是否使能过渡
- from : string //指定触发过渡的状态名,默认值是”*”,匹配所有状态
- to : string //过渡的目标状态名,默认值是”*”,匹配所有状态(如果from 和to不设置,则所有的状态变化都会触发)
- reversible : bool //状态从to变换到from时,是否触发过渡。
- running : bool //只读,当前过渡是否在运行
PropertyChanges 与PropertyAnimation
Rectangle { id: rect width: 100; height: 100 color: "red" states: State { name: "moved" PropertyChanges { target: rect; x: 50 } } transitions: Transition { PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } }}
ParentChange 与ParentAnimation
import QtQuick 2.0Item { width: 200; height: 100 Rectangle { id: redRect width: 100; height: 100 color: "red" } Rectangle { id: blueRect x: redRect.width width: 50; height: 50 color: "blue" states: State { name: "reparented" ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 } } transitions: Transition { ParentAnimation { NumberAnimation { properties: "x,y"; duration: 1000 } } } MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" } }}
AnchorChanges 与AnchorAnimation
import QtQuick 2.0Item { id: container width: 200; height: 200 Rectangle { id: myRect width: 100; height: 100 color: "red" } states: State { name: "reanchored" AnchorChanges { target: myRect; anchors.right: container.right } } transitions: Transition { // smoothly reanchor myRect and move into new position AnchorAnimation { duration: 1000 } } Component.onCompleted: container.state = "reanchored"}
StateChangeScript 与ScriptAction
State { name: "state1" StateChangeScript { name: "myScript" script: doStateStuff();//此状态被应用时, doStateStuff()会被执行 } // ...}// ...Transition { to: "state1" SequentialAnimation { NumberAnimation { /* ... */ } ScriptAction { scriptName: "myScript" } NumberAnimation { /* ... */ } }}
0 0
- State与Transition之Transition
- State与Transition之State
- EtherCAT State Transition
- transition
- transition
- transition
- transition
- transition
- QML中state元素与transition的使用个人体会
- transition,state的综合运用
- CSS3 transition与animation
- CSS3 过渡之transition
- CSS3之过渡Transition
- Android Animation之transition
- Android Animation之transition
- CSS3之过渡Transition
- iOS之Transition动画
- CSS3之过渡Transition
- 【进阶】MySQL中的子查询和联合查询
- SVM人脸识别
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- 在SSH框架中注入HibernateTemplate进行分页等相关查询
- 单例模式.md
- State与Transition之Transition
- 面试中被问到的概率题
- 错误pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')解决方案
- Spark之TopN
- NYOJ1237_最大岛屿
- 安卓自定义View介绍使用
- Spring+junit4 实现注解测试原理解析
- Windows 服务状态在启动或停止时卡住的解决办法
- 移动端吸顶、动画、浏览器层模型以及相关总结