|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
效果:
为了省事还是把MainForm.ui.qml删去,直接在main.qml文件敲代码:
- import QtQuick 2.5
- import QtQuick.Window 2.2
- Window {
- visible: true
- width: 500
- height: 500
- title: qsTr("Hello World")
- Rectangle{
- id:ball
- width:140
- height: 140
- radius: 70
- color:"#00B000"
- Text{
- anchors.centerIn: parent
- text:"Qt"
- font.family: "Trebuchet MS"
- color:"white"
- font.pointSize: 54
- }
- SequentialAnimation{
- running: true
- PathAnimation{
- target:ball
- duration: 3000
- easing.type: Easing.Linear
- path: Path {
- startX: 180; startY: 150//起始位置坐标
- PathArc {
- x: 179; y: 150//终止位置坐标
- radiusX: 150; radiusY: 100//半径
- useLargeArc: true
- }
- }
- }
- ScaleAnimator{
- target:ball
- duration:3000
- from:1
- to:5.5
- }
- }
- }
- }
复制代码
Preview: 明天学习动态创建和销毁对象
|
评分
-
查看全部评分
|