Cpper
C/C++高级工程师 Android高级软件工程师 IT集成工程师 音频工程师 熟悉c,c++,java,c#,py,js,asp等多种语言 程序猿
import QtQuick 2.2  
import QtQuick.Controls 1.1 
     
Image 
{
    width
: 240
    height: 240
    source: "assets/background.png"
    Image 
    {
        id: ufo
        y: 90
        x: 90
        width: 48
        height: 48
        source: "assets/ufo.png"
    
}
    
    ParallelAnimation
    
{
        id
: ani
        NumberAnimation
        {
            target: ufo
            properties: "width"
            to: 60
            duration: 600
        
}
        NumberAnimation
        
{
            target
: ufo
            properties: "height"
            to: 60
            duration: 600
        
}    
    }
        
    MouseArea 
    
{
        anchors.fill
: parent
        onClicked: 
        {
            ani.restart()
;
        
}
    }         
}
序列动画
import QtQuick 2.2  
import QtQuick.Controls 1.1 
     
Image 
{
    width
: 240
    height: 240
    source: "assets/background.png"
    Image 
    {
        id: ufo
        y: 90
        x: 90
        width: 48
        height: 48
        source: "assets/ufo.png"
    
}
    
    SequentialAnimation
    
{
        id
: ani
        NumberAnimation
        {
            target: ufo
            properties: "width"
            to: 60
            duration: 600
        
}
        NumberAnimation
        
{
            target
: ufo
            properties: "height"
            to: 60
            duration: 600
        
}    
    }
        
    MouseArea 
    
{
        anchors.fill
: parent
        onClicked: 
        {
            ani.restart()
;
        
}
    }         
}

posted on 2015-08-20 13:41 ccsdu2009 阅读(591) 评论(0)  编辑 收藏 引用 所属分类: QT编程

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理