-
Notifications
You must be signed in to change notification settings - Fork 0
/
clock.h
38 lines (32 loc) · 885 Bytes
/
clock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef CLOCK_H
#define CLOCK_H
#include <QWidget>
#include <QtGui>
#include <math.h>
class Clock : public QWidget
{
Q_OBJECT
public:
Clock(QWidget *parent = 0);
~Clock();
void paintEvent(QPaintEvent * e);
void drawBase(QPainter &paint);
void drawGraduation(QPainter &paint);
void drawValue(QPainter &paint);
void drawHours(QPainter &paint, double alpha);
void drawMinutes(QPainter &paint, double alpha);
void drawSeconds(QPainter &paint, double alpha);
void drawCenter(QPainter &paint);
void clear(QPainter &paint);
void timerEvent(QTimerEvent *);
void initTime();
void recountTime();
QPair<double, double> getPoint(double nowX, double nowY, double alpha);
private:
int Ox,Oy;
int seconds,minutes,hours;
double upX,upY;
double alphaSec,alphaMin,alphaHours;
bool first;
};
#endif // CLOCK_H