-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskinbutton.h
47 lines (34 loc) · 817 Bytes
/
skinbutton.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
#ifndef SKINBUTTON_H
#define SKINBUTTON_H
#include <QPushButton>
class SkinButton : public QPushButton
{
Q_OBJECT
public:
typedef enum{
ButtonNormal = 0,
ButtonHovered = 1,
ButtonPressed = 2,
ButtonDisabeled = 3,
}ButtonState;
public:
explicit SkinButton(qint32 type, QWidget *parent = 0);
~SkinButton() {}
public slots:
void setIndex(bool checked);
//void setIndex(qint8 index);
protected:
QSize sizeHint() const;
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void paintEvent(QPaintEvent *);
private:
QPixmap getStatePixmap() const;
private:
qint32 m_type;
qint8 m_index;
ButtonState m_state;
};
#endif // SKINBUTTON_H