国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

QML翻轉(zhuǎn)效果Demo

2019-11-11 02:25:55
字體:
供稿:網(wǎng)友

這個(gè)demo我是根據(jù)Qt提供的例子為參考做的,可以先看一下效果:

這個(gè)Demo的源碼我已經(jīng)上傳到CSDN,可以下載O(∩_∩)O哈!

源碼地址:http://download.csdn.net/detail/u014597198/9748736

核心的卡片代碼如下:

import QtQuick 2.0
Flipable {
    id: container
    PRoperty alias source: frontImage.source
    property bool flipped: true
    property int xAxis: 0
    property int yAxis: 0
    property int angle: 0
//    width: front.width; height: front.height
    width: 60;
    height: 80;
    front: Image { id: frontImage; anchors.fill: parent }
    back: Image { source: "qrc:/puke/back.png"; anchors.fill: parent }
    state: "back"
    MouseArea { anchors.fill: parent; onClicked: container.flipped = !container.flipped }
    transform: Rotation {
        id: rotation; origin.x: container.width / 2; origin.y: container.height / 2
        axis.x: container.xAxis; axis.y: container.yAxis; axis.z: 0
    }
    states: State {
        name: "back"; when: container.flipped
        PropertyChanges { target: rotation; angle: container.angle }
    }
    transitions: Transition {
        ParallelAnimation {
            NumberAnimation { target: rotation; properties: "angle"; duration: 600 }
            SequentialAnimation {
                NumberAnimation { target: container; property: "scale"; to: 0.75; duration: 300 }
                NumberAnimation { target: container; property: "scale"; to: 1.0; duration: 300 }
            }
        }
    }
}


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 威远县| 蒲江县| 年辖:市辖区| 丰镇市| 陆丰市| 杭州市| 密云县| 阿图什市| 新田县| 铜陵市| 宜丰县| 双流县| 宜州市| 澄江县| 万载县| 扎鲁特旗| 石楼县| 宜川县| 始兴县| 抚州市| 芦山县| 若尔盖县| 从江县| 乌拉特中旗| 神木县| 太仆寺旗| 渝北区| 潍坊市| 沁阳市| 渝中区| 彭山县| 北碚区| 监利县| 金溪县| 彰化县| 兴文县| 南雄市| 开封县| 扬中市| 彭州市| 信宜市|