資源簡介
QT寫的動畫顯示源代碼,成功運行,非常好用,是學習QT開發技術的好資料!

代碼片段和文件信息
#include?
#include?
#include?
#include?
int?main(int?argc?char*?argv[?])
{
????QApplication?app(argc?argv);
????QPushButton?button(“Animated?Button“);
????button.show();
????//按鈕部件的動畫1
????QPropertyAnimation?*animation1?=?new?QPropertyAnimation(&button?“geometry“);
????animation1->setDuration(2000);
????animation1->setStartValue(QRect(250?0?100?30));
????animation1->setEndValue(QRect(250?300?100?30));
????animation1->setEasingCurve(QEasingCurve::OutBounce);
????//按鈕部件的動畫2
????QPropertyAnimation?*animation2?=?new?QPropertyAnimation(&button?“geometry“);
????animation2->setDuration(1000);
????animation2->setStartValue(QRect(250?300?100?30));
????animation2->setEndValue(QRect(250?300?200?60));
????//串行動畫組
????QSequentialAnimationGroup?group;
????group.addAnimation(animation1);
????group.addAnimation(animation2);
????group.start();
????return?app.exec();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1025??2013-08-16?13:05??myAnimation\main.cpp
?????文件?????????30??2011-06-21?11:14??myAnimation\myAnimation.pro
?????目錄??????????0??2013-08-16?13:07??myAnimation
-----------?---------??----------?-----??----
?????????????????1055????????????????????3
- 上一篇:調用百度地圖API顯示虛線運動軌跡
- 下一篇:鎖相環verilog代碼
評論
共有 條評論