1,其它动画元素
2,源码

import QtQuick 2.0

Rectangle{
    width: 80
    height: 80

    //动画元素允许颜色设置,作用越颜色
    ColorAnimation on color {
        from: "blue"
        to: "aqua"
        duration: 10000
        loops: Animation.Infinite
    }

    //动画元素允许设定图形旋转,作用越rotation
    RotationAnimation on rotation {
        from: 0
        to: 360
        duration: 10000
        direction: RotationAnimation.Clockwise
        loops: Animation.Infinite
    }

    //允许数字类型的值改变动画元素,作用于radius
    NumberAnimation on radius {
        from: 0
        to: 40
        duration: 10000
        loops: Animation.Infinite
    }

    //属性动画元素
    PropertyAnimation on x{
        from: 50
        to: 500
        duration: 10000
        loops: Animation.Infinite
        easing.type: easing.InOutQuad
    }
}

import QtQuick 2.6

Rectangle {
    property alias mouseArea: mouseArea
    property alias textEdit: textEdit

    width: 360
    height: 360

    MouseArea {
        id: mouseArea
        anchors.fill: parent
    }

    TextEdit {
        id: textEdit
        visible: false
    }

    CircleRect{
        x: 50; y:30
    }
}

3,效果
第14章:QML之 OhterAnimation

相关文章:

  • 2021-05-30
  • 2021-12-29
  • 2021-11-28
  • 2021-11-23
  • 2021-05-26
  • 2021-07-30
  • 2022-02-03
猜你喜欢
  • 2021-06-07
  • 2021-06-01
  • 2021-10-06
  • 2021-07-16
  • 2021-12-01
  • 2022-01-16
  • 2021-10-20
相关资源
相似解决方案