主要代码
#include "oventimer.h"
#include "ui_oventimer.h"
#ifndef M_PI
#define M_PI 3.1415926359
#endif
//每分钟以及每秒的度数
const double DegreesPerMinute =7.0;
const double DegreesPerSecond = DegreesPerMinute/60;
const int MaxMinute=45;
const int MaxSeconds=MaxMinute*60;
const int UpdateInterval =3; //3s转动一次
OvenTimer::OvenTimer(QWidget *parent) :
QWidget(parent),
ui(new Ui::OvenTimer)
{
ui->setupUi(this);
updateTimer=new QTimer(this);
connect(updateTimer,SIGNAL(timeout()),this,SLOT(update()));
finishTimer=new QTimer();
finishTimer->setSingleShot(true);
connect(finishTimer,SIGNAL(timeout()),this,SLOT(onTimeout()));//SLOT(timeout()) OvenTimer的
QFont font;
font.setPointSize(8);
setFont(font);
}
OvenTimer::~OvenTimer()
{