新建一个Circle.qml的文件用来显示一个圆的形状
显示效果如下所示:
新建一个圆形,后面我们会使用到。先放在这里,这个还是比较好玩的。
具体代码如下:
import QtQuick 2.15
Rectangle{
id:circ0
property real r:100 //圆的半径
width:r * 2. //圆的宽度
height:r * 2. //圆的高度
radius:r //圆的半径
color: "red"
property point offset //偏移量
property point finalCenter:Qt.point(x + anim_x + width * .5,y + anim_y + height * .5)
property real anim_x:0 //动画X
property real anim_y:0 //动画Y
property vector4d param4d:Qt.vector4d((x + anim_x + width * .5)/720,(y + anim_y + width * .5)/720,width/720/2,0.07)
}