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
联系方式:
| 作者 | 郑天佐 |
|---|---|
| 278969898 | |
| 主页 | http://www.camelstudio.cn |
| 邮箱 | camelsoft@163.com |
| 博客 | http://blog.csdn.net/zhengtianzuo06 |
| github | https://github.com/zhengtianzuo |
| QQ群 | 199672080 |

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