Cpper
C/C++高级工程师 Android高级软件工程师 IT集成工程师 音频工程师 熟悉c,c++,java,c#,py,js,asp等多种语言 程序猿
import QtQuick 2.2

Rectangle
{
    id
: rootItem
    width: 360
    height: 360
    color: "#cfcfcf"

    property int targetWidth: 0

    Rectangle{
        id: rect1
        width:360
        height:rootItem.height
        color:"#808080"
    
}

    Rectangle
{
        id
: rect2
        width:rootItem.width-rect1.width
        height:parent.height
        x:rootItem.width
        color:"#c0c0c0"
    
}

    Button
{
        text
: "Button"
        anchors.centerIn: parent
        onClicked: {
            animation.start()
        
}
    }

    NumberAnimation
{
        id
: animation
        target: rect1
        properties:  "width"
        to: rootItem.targetWidth
        duration: 720

        onStopped: rootItem.targetWidth = rootItem.width - to
    
}
}
posted on 2019-09-06 17:47 ccsdu2009 阅读(463) 评论(0)  编辑 收藏 引用 所属分类: QT编程

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