【Qt Quick】立体旋转图片

简介

我在做通讯软件练习的时候,在登录界面点击注册按钮的时候,让整个窗口立体旋转

代码

    transform: Rotation{
        //围绕哪个点开始旋转
        origin.x: root.width/2
        origin.y: root.height/2

        //绕着Y轴旋转
        axis{
            x: 0
            y: 1
            z: 0
        }
        //角度动画
        NumberAnimation on angle{
            id:na_Rotation
            running: false
            from: 0
            to: 90
            duration: 1000
            //loops: Animation.Infinite//无限循环
        }
    }

使用

    //注册账号
    Text {
        id: text_RegisterAnAccount
        text: qsTr("注册账号")
        opacity: 0.5
        font{
            bold:true
            pixelSize: root.fontSize - 4
        }
        anchors{
            left: parent.left
            leftMargin: 10
            bottom: parent.bottom
            bottomMargin: 10
        }
        MouseArea{
            anchors.fill: parent
            onClicked: {
            	//动画运行
                na_Rotation.running = true
            }
        }
    }

效果

请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

非西昂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值