qml一个程序里多个loops动画对另一个程序qml显示的刷新的影响
来源:互联网 发布:python 推荐系统 编辑:程序博客网 时间:2024/05/18 14:23
property int rpm: 1000 property real rpmAngleTo: 270 / 10000 * rpm property int speed: 150 property real speedAngleTo: 270 / 200 * speedtransitions: [ Transition { from: "" to: "show" ParallelAnimation{ NumberAnimation { target: dashboardPanel; property: "opacity"; to: 1.0; duration: 100; } SequentialAnimation{ NumberAnimation { target: dashboardPanel; property: "speed"; to: 200; duration: 800; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 0; duration: 800; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 100; duration: 500; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 80; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 90; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 100; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 118; duration: 1000; } SequentialAnimation{ loops: Animation.Infinite NumberAnimation { target: dashboardPanel; property: "speed"; from: 118;to: 120; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 110; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 115; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 118; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 110; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 115; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "speed"; to: 118; duration: 1000; } } } SequentialAnimation{ NumberAnimation { target: dashboardPanel; property: "rpm"; to: 8000; duration: 600; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: /*12*/0; duration: 600; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 3000; duration: 700; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 4000; duration: 800; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 5000; duration: 1000; } SequentialAnimation{ loops: Animation.Infinite NumberAnimation { target: dashboardPanel; property: "rpm"; from:5000;to: 4500; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 4800; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 5000; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 4600; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 4300; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 4600; duration: 1000; } NumberAnimation { target: dashboardPanel; property: "rpm"; to: 5000; duration: 1000; } } } } }, Transition { from: "show" to: "" SequentialAnimation{ NumberAnimation { target: dashboardPanel; property: "opacity"; to: 0.0; duration: 100; } ScriptAction{ script: { dashboardPanel.state = "show" } } } } ]另一个程序,检测网络发来了数据,通过emit nameChanged(),通知qml变量发生变化,刷新显示,虽然qml打印出来的数据发生了变化,但是显示未变化,只是一开始变化,一两次。这种原因就是因为上面的程序同一个动画里出现了两次loops无限循环,其中一个rpm动画是几百几百的变化,如果变化from ,to的值都去掉一个0,变化几十几十的变化,就不影响显示,单独让rpm变化,显示动一两次,然后就不变了,但是收到的数据还是变化的,这种原因可能是太耗资源导致的,导致太耗资源的真正原因是rpm定义成了real 类型的,如果改成int 类型就不会有这种出乎意料的现象出现。 Text { id: speed anchors.right: km_h.left anchors.rightMargin: 5 y:15// font.family:FontName.fontCurrentMicroSoftYahei font.pixelSize: 40 opacity: 1.0 color: "#69d0ff" text:{ console.log("speed"+carStatus.speed) return carStatus.speed }
0 0
- qml一个程序里多个loops动画对另一个程序qml显示的刷新的影响
- QML小结1-(一个简单的qml程序)
- QML小结1-(一个简单的qml程序)
- QML程序的发布
- Qt Quick学习---------------构建一个简单的qml程序
- qml-------------实现一个简单的图片加载程序
- Qt Quick学习---------------构建一个简单的qml程序
- qml 全屏显示的一个小记录
- 一个QML的启动器
- Qt5 QML程序Release版本发布程序无法显示的问题解决过程。
- 纯QML程序添加开启动画
- QML中多个动画的操作
- QML中多个动画的操作
- 用QML实现一个调色程序
- QML中计时器的使用,实现一个简单的倒计时程序
- Qml程序版本信息
- 用qt的qml写的安卓摄像头程序
- QT c++程序使用qml的两种方法
- springmvc form:select 标签 map用法
- subversion(server)与TortoiseSVN(client)的安装与简单使用
- 08-每天一个Linux命令 cp
- mongo cloud manager
- DataTables 参数详解
- qml一个程序里多个loops动画对另一个程序qml显示的刷新的影响
- 修改用户头像后显示的是修改之前的头像(SDWebImage加载网络图片)
- 三 Swift 3.0之 类型转换
- JDK源代码阅读:HashMap
- 盘点2016的那些主流android框架和技术
- 初识linux权限
- Junit4 简单教程
- JS如何判断一个对象是否为空
- 用css美化英文链接