QML文档阅读笔记-easing.type解析与实例
生活随笔
收集整理的這篇文章主要介紹了
QML文档阅读笔记-easing.type解析与实例
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
easing.type
指定動態緩和曲線
官方給出的偽代碼:
?
很有意思的一個屬性!
其中的參數為:
PropertyAnimation::easing.type
在Qt助手里面可查,相關緩和程度
?
在此,給出一個例子
運行截圖如下:
偽代碼如下:
(拷貝到QML文件里面加一個根結點就可以跑)
Text {id: helloTexttext: qsTr("Hello world")color: "blue"font.pixelSize: 50font.family: "Times New Roman"anchors.centerIn: parentMouseArea {id: mouseAreaanchors.fill: parent}states: State {name: "down"when: mouseArea.pressed === truePropertyChanges {target: helloTextrotation : 360color: "red"}}transitions: Transition {from: ""to: "down"reversible: trueParallelAnimation {NumberAnimation { properties: "rotation"; duration: 500; easing.type: Easing.InOutQuad }ColorAnimation { duration: 500 }}}}?
總結
以上是生活随笔為你收集整理的QML文档阅读笔记-easing.type解析与实例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Qt工作笔记-使用QGraphicsIt
- 下一篇: Qt5.8 Windows端 关于 St