QPropertyAnimation动画 可以运行的例子
2015-06-25 15:49
357 查看
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QPixmap>
#include <QPropertyAnimation>
#include <QLabel>
int main(int argc, char *argv[])
{
/*
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
*/
QApplication app(argc,argv);
QWidget *w=new QWidget();
w->resize(300,400);
QPixmap birdimg(20,20);
birdimg.fill(Qt::red);
QLabel *bird_1=new QLabel(w);
bird_1->setPixmap(birdimg);
QPropertyAnimation *anim1=new QPropertyAnimation(bird_1, "pos");
anim1->setDuration(2000);
anim1->setStartValue(QPoint(0, 0));
anim1->setEndValue(QPoint(200, 300));
anim1->start();
bird_1->move(-40,-40);
w->show();
return app.exec();
}
相关文章推荐
- BeanUtils的populate方法之日期处理
- centos下 No package 'glib-2.0' found的解决办法
- 给VM虚拟机中的CentOS Linux系统挂载U盘的方法图文教程
- ubuntu下nginx编译安装
- MediaProxy的Web监控界面及多Relay情景配置
- Linux vim查找与替换操作及快捷键
- linux下的c/c++调试器gdb
- 架构师之路(39)---IoC框架
- 赞一个 kindle电子书有最新的计算机图书可买了【Docker技术入门与实战】
- Linux vim光标移动快捷键
- linux搭建svn服务
- Linux命令之grep命令使用介绍
- Linux下优秀的音频编辑软件
- nginx filter
- Linux命令之cut命令使用介绍
- apache 简单笔记
- Linux命令之awk命令使用介绍
- linux下安装PHP扩展
- Info.plist Utility Error: “Info.plist couldn't be opened because there is no such file”
- Linux命令之sed命令使用介绍