-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathToolButton.h
More file actions
39 lines (28 loc) · 779 Bytes
/
ToolButton.h
File metadata and controls
39 lines (28 loc) · 779 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
31
32
33
34
35
36
37
38
39
#ifndef TOOLBUTTON_H
#define TOOLBUTTON_H
#include <QToolButton>
class QParallelAnimationGroup;
class ToolButton : public QToolButton
{
Q_OBJECT
public:
explicit ToolButton(QWidget *parent = 0);
~ToolButton();
void setPixmap(const QString &pixSmall, const QString &pixBig);
protected:
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *event);
void leaveEvent(QEvent *event);
private:
///< \note 用于存放所绘制的图片.
QPixmap _pixmap_small;
QPixmap _pixmap_big;
///< \note 绘制图片路径.
QString _pix_small;
QString _pix_big;
///< \note 是否绘制小图标.
bool _is_draw_small;
///< \note 显示图标的渐进动画.
QParallelAnimationGroup *_group;
};
#endif // TOOLBUTTON_H