資源簡(jiǎn)介
Qt實(shí)現(xiàn)的日歷時(shí)鐘程序,日歷可以調(diào)整日歷大小,時(shí)鐘可以調(diào)整時(shí)間
代碼片段和文件信息
#include?“clock.h“
#include?
#include?
#include?
Clock::Clock(QWidget?*parentint?widthint?heightQTime?changeTime)?:
????QWidget(parent)
{
//????QTimer?*timer=new?QTimer(this);
//????connect(timerSIGNAL(timeout())thisSLOT(updateForm()));
//????timer->start(200);
????time?=?changeTime;
????resize(widthheight);
}
void?Clock::updateForm()
{
????emit?updateTime();
????update();
}
void?Clock::paintEvent(QPaintEvent?*)
{
????static?const?QPoint?hourHand[3]={
????????QPoint(78)
????????QPoint(-78)
????????QPoint(0-40)
????};
????static?const?QPoint?minuteHand[3]={
????????QPoint(78)
????????QPoint(-78)
????????QPoint(0-70)
????};
????static?const?QPoint?secondHand[3]={
????????QPoint(69)
????????QPoint(-69)
????????QPoint(0-90)
????};
????QColor?hourColor(1270127);
????QColor?minuteColor(0127127191);
????QColor?secondColor(0887766);
????int?side=qMin(width()height());
????//QTime?time=QTi
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????413??2014-12-15?22:13??Calender\Calender.pro
?????文件??????77824??2014-12-15?23:29??Calender\Calender.pro.user
?????文件???????2180??2014-12-15?22:16??Calender\clock.cpp
?????文件????????457??2014-12-15?22:16??Calender\clock.h
?????文件????????183??2014-12-15?22:12??Calender\main.cpp
?????文件???????6233??2014-12-15?22:23??Calender\mainwindow.cpp
?????文件????????849??2014-12-15?22:25??Calender\mainwindow.h
?????文件???????4255??2014-12-15?23:27??Calender\mainwindow.ui
?????目錄??????????0??2014-12-15?23:29??Calender
-----------?---------??----------?-----??----
????????????????92394????????????????????9
評(píng)論
共有 條評(píng)論