-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvigilbutton.h
56 lines (48 loc) · 1.27 KB
/
vigilbutton.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef VIGILBUTTON_H
#define VIGILBUTTON_H
#include <QObject>
#include <iostream>
#include <QAbstractButton>
#include <QColor>
#include <QPalette>
#include <QPainter>
#include <QGradient>
#include <QPainterPath>
#include <QPaintEvent>
#include <QLCDNumber>
#include "vigilbuttonpalette.h"
#include "customshadoweffect.h"
#include "model.h"
#include <chrono>
class VigilButton : public QAbstractButton
{
Q_OBJECT
public:
enum VigilColor {BLUE,RED,ORANGE,GREEN,GRAY,LIGHT_GREEN,LIGHT_BLUE};
Q_ENUM(VigilColor)
enum Shape {FACTORY,ROUND, DEFAULT};
Q_ENUM(Shape)
VigilButton(QWidget *parent = 0);
VigilButton(const QString &text,int w, int h, VigilColor VigilColor = GRAY, Shape shape = DEFAULT, QWidget *parent = 0);
void setShape(Shape s);
void setColor(VigilColor c);
void setFontSize(int size);
void setid(int id);
void setmodel(Model* model);
void setLcdNb(QLCDNumber* nb);
protected:
void paintEvent(QPaintEvent* e);
void mousePressEvent(QMouseEvent * e);
void mouseReleaseEvent(QMouseEvent * e);
private:
VigilButtonPalette bp;
CustomShadowEffect bodyShadow;
QFont timesFont;
int fontSize;
int xRadius, yRadius;
int _id;
Model *_model;
QLCDNumber *_lcdnb;
int _counter;
};
#endif // VIGILBUTTON_H