資源簡介
QT寫的動(dòng)畫顯示源代碼,成功運(yùn)行,非常好用,是學(xué)習(xí)QT開發(fā)技術(shù)的好資料!

代碼片段和文件信息
#include?
#include?
#include?
#include?
int?main(int?argc?char*?argv[?])
{
????QApplication?app(argc?argv);
????QPushButton?button(“Animated?Button“);
????button.show();
????//按鈕部件的動(dòng)畫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);
????//按鈕部件的動(dòng)畫2
????QPropertyAnimation?*animation2?=?new?QPropertyAnimation(&button?“geometry“);
????animation2->setDuration(1000);
????animation2->setStartValue(QRect(250?300?100?30));
????animation2->setEndValue(QRect(250?300?200?60));
????//串行動(dòng)畫組
????QSequentialAnimationGroup?group;
????group.addAnimation(animation1);
????group.addAnimation(animation2);
????group.start();
????return?app.exec();
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????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
評(píng)論
共有 條評(píng)論