Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1069677
  • 博文数量: 264
  • 博客积分: 6005
  • 博客等级: 大校
  • 技术积分: 2798
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-08 20:15
文章分类

全部博文(264)

文章存档

2011年(42)

2010年(213)

2009年(4)

2008年(2)

2007年(3)

分类:

2010-10-14 21:59:27


Rectangle {
    id: myRect; width: 640; height: 400; state: "OldState"
    Rectangle { id: movingRect; width: 60; height: 60; color: "red"
        MouseArea { anchors.fill: parent; 
                    onClicked: if (myRect.state == "OldState") myRect.state = "NewState"; 
                               else myRect.state = "OldState" }
    }
    states: [
        State {
            name: "NewState"
            PropertyChanges { target: movingRect; x: 580; y: 340; radius: 30; color: "green" }
        }
    ]
    transitions: [
        Transition {
            from: "OldState"; to: "NewState"
            PropertyAnimation { properties: "x,y,color,radius"; duration: 1000 }
        },
        Transition {
            from: "NewState"; to: "OldState"
            PropertyAnimation { properties: "x,y,color,radius"; duration: 1000 }
        }
    ]
}

阅读(834) | 评论(0) | 转发(0) |
0

上一篇:qml Particle Effects

下一篇:qml 字体

给主人留下些什么吧!~~