首页 > 其他 > 详细

Qt 动画之QPropertyAnimation

时间:2018-09-05 10:59:15      阅读:314      评论:0      收藏:0      [点我收藏+]
 1 //定义
 2 QPropertyAnimation* _pAnimation= new QPropertyAnimation(this, "geometry");
 3 //设置动画持续时间
 4 _pAnimation _pAnimation->setDuration(200);
 5 //开始位置
 6 _pAnimation->setKeyValueAt(0, QRect(rect().left(), rect().top(), rect().width(), rect().height()));
 7 //结束位置
 8  _pAnimation->setKeyValueAt(1, QRect(rect().left(), -rect().height(), rect().width(), rect().height()));
 9 //开始动画效果
10  _pAnimation->start();

 

Qt 动画之QPropertyAnimation

原文:https://www.cnblogs.com/wxh-53919/p/9590801.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!