-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtoolbutton.h
More file actions
30 lines (26 loc) · 819 Bytes
/
Copy pathtoolbutton.h
File metadata and controls
30 lines (26 loc) · 819 Bytes
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
#ifndef TOOLBUTTON_H
#define TOOLBUTTON_H
#include <QWidget>
#include <QToolButton>
#include <QColor>
#include <QString>
class ToolButton : public QToolButton
{
Q_OBJECT
public:
ToolButton(QWidget* parent,QColor p_color,QColor e_color);
ToolButton(QWidget *parent);
~ToolButton();
setPlainColor(QColor color); //修改鼠标未进入时按钮颜色
setEnterColor(QColor color); //修改鼠标进入时按钮颜色
QString toRGBAString(QColor color); //将颜色转换为RGBA值
protected:
void enterEvent(QEvent* event);
void leaveEvent(QEvent* event);
protected slots:
private:
QColor plainColor; //鼠标未进入时按钮颜色
QColor enterColor; //鼠标进入时按钮颜色
signals:
};
#endif // TOOLBUTTON_H