2016-03-19 07:50:48 +00:00
|
|
|
#ifndef ICONBUTTON_H
|
|
|
|
#define ICONBUTTON_H
|
|
|
|
|
|
|
|
#include <QAbstractButton>
|
|
|
|
|
2016-05-29 21:26:42 +00:00
|
|
|
class IconButtonPrivate;
|
2016-03-19 07:50:48 +00:00
|
|
|
|
|
|
|
class IconButton : public QAbstractButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit IconButton(const QIcon &icon, QWidget *parent = 0);
|
|
|
|
~IconButton();
|
|
|
|
|
|
|
|
QSize sizeHint() const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
2016-05-29 21:26:42 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
2016-03-19 07:50:48 +00:00
|
|
|
|
2016-05-29 21:26:42 +00:00
|
|
|
const QScopedPointer<IconButtonPrivate> d_ptr;
|
2016-03-19 07:50:48 +00:00
|
|
|
|
2016-05-29 21:26:42 +00:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(IconButton)
|
|
|
|
Q_DECLARE_PRIVATE(IconButton)
|
2016-03-19 07:50:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ICONBUTTON_H
|