資源簡(jiǎn)介
這是一個(gè)仿安卓的時(shí)鐘顯示qt工程代碼,支持三種特效類似日歷的翻頁,自上而下的滑動(dòng),前后翻轉(zhuǎn),三種特效。可以下載解壓后可以直接編譯運(yùn)行
代碼片段和文件信息
#include?
#include?
class?Digits:?public?QWidget
{
????Q_object
public:
????/*Define?three?transition?modes?of?the?digital?clock*/
????enum?{
????????Slide
????????Flip
????????Rotate
????};
????Digits(QWidget?*parent)
????????:?QWidget(parent)
?????????m_number(0)
?????????m_transition(Slide)
????{
????????setAttribute(Qt::WA_OpaquePaintEvent?true);
????????//Widget?paints?all?its?pixels?when?it?receives?a?paint?event
????????setAttribute(Qt::WA_NoSystemBackground?true);
????????//Indicates?that?the?widget?has?no?background?i.e.?when?the?widget?receives?paint?events?the?background?is?not?automatically?repainted.
????????connect(&m_animator?SIGNAL(frameChanged(int))?SLOT(update()));
????????//start?animation
????????m_animator.setframeRange(0?100);
????????
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-06-10?03:41??timer\
?????文件?????????690??2015-06-10?03:32??timer\mainwindow.h
?????文件?????????373??2015-06-10?02:32??timer\timer.pro
?????文件????????8416??2015-06-10?03:30??timer\digits.cpp
?????文件????????1567??2015-06-10?03:26??timer\Digits.h
?????文件????????3090??2015-06-10?03:41??timer\mainwindow.cpp
?????文件???????18253??2015-06-10?02:01??timer\timer.pro.user
?????文件?????????306??2015-06-10?02:09??timer\main.cpp
?????文件???????13984??2015-06-10?01:57??timer\1.cpp
評(píng)論
共有 條評(píng)論