forked from kakaZzzz/dpc_linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustombutton.h
36 lines (30 loc) · 839 Bytes
/
custombutton.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
#ifndef CUSTOMBUTTON_H
#define CUSTOMBUTTON_H
#include <QObject>
#include <QWidget>
#include <QPushButton>
#include <QPaintEvent>
#include <QEvent>
// tab button
class tabButton : public QPushButton
{
Q_OBJECT
public:
tabButton(QString image_path, QWidget *parent, QString text = "");
~tabButton();
// set tab check
void setTabCheck(bool check);
protected:
void enterEvent(QEvent*);
void leaveEvent(QEvent*);
void paintEvent(QPaintEvent* e);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
private:
QList<QPixmap> m_list_pixmap;
int m_index;
bool m_enter;
bool m_check;
QString m_text;
};
#endif // CUSTOMBUTTON_H