資源簡介
自實(shí)現(xiàn)的一個(gè)翻轉(zhuǎn)QWidget的demo;采用QPainter和QPropertyAnimation實(shí)現(xiàn),是一個(gè)學(xué)習(xí)動(dòng)畫設(shè)計(jì)的高效demo
代碼片段和文件信息
#include?“widget.h“
#include?
#include?“transformwidget.h“
#include?
#include?
#include?
#include?
#include?
int?main(int?argc?char?*argv[])
{
????QApplication?a(argc?argv);
????QLabel?*label?=?new?QLabel;
????label->setPixmap(QPixmap(“:/trash.png“));
????TransformWidget?w;
????w.setFront(label);
????label->resize(128128);
????label?=?new?QLabel;
????label->setPixmap(QPixmap(“:/test.png“));
????w.setBack(label);
????label->resize(128128);
????QTimer?tm;
????tm.setInterval(3500);
????Qobject::connect(&tm&QTimer::timeout[&]{w.start();});
????w.resize(128128);
????w.show();
????tm.start();
????return?a.exec();
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????1035??2017-12-07?21:21??flicp\flicp.pro
?????文件??????23784??2017-12-07?21:52??flicp\flicp.pro.user
?????文件????????124??2017-12-07?21:21??flicp\img.qrc
?????文件????????737??2017-12-07?21:21??flicp\main.cpp
?????文件???????6554??2017-12-07?21:21??flicp\test.png
?????文件???????2427??2017-12-07?21:21??flicp\transformwidget.cpp
?????文件????????814??2017-12-07?21:21??flicp\transformwidget.h
?????文件???????3296??2017-12-07?21:21??flicp\trash.png
?????文件???????1317??2017-12-07?21:21??flicp\widget.cpp
?????文件????????730??2017-12-07?21:21??flicp\widget.h
?????目錄??????????0??2017-12-07?21:52??flicp
-----------?---------??----------?-----??----
????????????????40818????????????????????11
評(píng)論
共有 條評(píng)論