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

导航

<2011年6月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
统计
  • 随笔 - 379
  • 文章 - 2
  • 评论 - 439
  • 引用 - 0

常用链接

留言簿(26)

随笔分类(335)

随笔档案(379)

文章档案(2)

XYZ

程序员

积分与排名

  • 积分 - 772166
  • 排名 - 19

最新随笔

最新评论

阅读排行榜

评论排行榜

 
import QtQuick 2.11

Rectangle 
{
    width
: 640
    height: 480
    color: "#0909ff"

    Flipable {
            id: flip
            width: 300
            height: 300
            anchors.centerIn: parent

            property bool flipped: false

            front:Image{
                anchors.fill: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"
            
}

            back:Image
{
                anchors.fill
: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720-flip.png"
            
}

            transform: Rotation
{
                id
: rotation
                origin.x: flip.width / 2
                origin.y: flip.height / 2
                axis.x: 0
                axis.y: 1
                axis.z: 0
                angle: 0
            
}

            states:State
{
                PropertyChanges {
                    target
: rotation
                    angle: 180
                
}
                when:flip.flipped
            }

            transitions: Transition
{
                NumberAnimation{
                    target
:rotation
                    properties: "angle"
                    duration: 240
                
}
            }

            MouseArea 
{
                anchors.fill
: parent

                onClicked:  flip.flipped = !flip.flipped

            
}
        }
}
posted on 2019-09-19 17:33 ccsdu2009 阅读(857) 评论(0)  编辑 收藏 引用 所属分类: QT编程