Qml旋转箭头

一个向右的箭头, 点击顺时针旋转90°, 再次点击逆时针旋转90°

Image {id: imageheight: 24width: 24anchors.centerIn: parentsource: "qrc:/image.png"MouseArea{anchors.fill: parentonClicked:{if (rotationAnimation.running === true) return;rotationAnimation.start();}}}RotationAnimation{id: rotationAnimationtarget: imagefrom: 0to: 90duration: 100onStopped: {if (isDown === true){rotationAnimation.from = 0;rotationAnimation.to = 90;}else{rotationAnimation.from = 90;rotationAnimation.to = 0;}isDown = !isDown;}}

在这里插入图片描述

需要完整代码请访问QtQuickExamples

联系方式:

作者郑天佐
QQ278969898
主页http://www.camelstudio.cn
邮箱camelsoft@163.com
博客http://blog.csdn.net/zhengtianzuo06
githubhttps://github.com/zhengtianzuo
QQ群199672080

在这里插入图片描述

觉得分享的内容还不错, 就请作者喝杯咖啡吧~~


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部