2017-09-29 09:56:51 +00:00
|
|
|
#ifndef QTMATERIALICONBUTTON_H
|
|
|
|
#define QTMATERIALICONBUTTON_H
|
|
|
|
|
2017-09-29 09:57:42 +00:00
|
|
|
#include <QtWidgets/QAbstractButton>
|
2017-09-29 09:56:51 +00:00
|
|
|
|
2022-02-17 01:23:36 +00:00
|
|
|
namespace md
|
|
|
|
{
|
|
|
|
|
|
|
|
class IconButtonPrivate;
|
2017-09-29 09:56:51 +00:00
|
|
|
|
2022-02-17 01:23:36 +00:00
|
|
|
class IconButton : public QAbstractButton
|
2017-09-29 09:56:51 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-02-17 01:23:36 +00:00
|
|
|
explicit IconButton(const QIcon &icon, QWidget *parent = 0);
|
|
|
|
~IconButton();
|
2017-09-29 09:56:51 +00:00
|
|
|
|
|
|
|
QSize sizeHint() const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void setUseThemeColors(bool value);
|
|
|
|
bool useThemeColors() const;
|
|
|
|
|
|
|
|
void setColor(const QColor &color);
|
|
|
|
QColor color() const;
|
|
|
|
|
|
|
|
void setDisabledColor(const QColor &color);
|
|
|
|
QColor disabledColor() const;
|
|
|
|
|
|
|
|
protected:
|
2022-02-17 01:23:36 +00:00
|
|
|
IconButton(IconButtonPrivate &d, QWidget *parent = 0);
|
2017-09-29 09:56:51 +00:00
|
|
|
|
|
|
|
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
2017-10-01 19:34:55 +00:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
|
2017-09-29 09:56:51 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
2022-02-17 01:23:36 +00:00
|
|
|
const QScopedPointer<IconButtonPrivate> d_ptr;
|
2017-09-29 09:56:51 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-17 01:23:36 +00:00
|
|
|
Q_DISABLE_COPY(IconButton)
|
|
|
|
Q_DECLARE_PRIVATE(IconButton)
|
2017-09-29 09:56:51 +00:00
|
|
|
};
|
|
|
|
|
2022-02-17 01:23:36 +00:00
|
|
|
}
|
|
|
|
|
2017-09-29 09:56:51 +00:00
|
|
|
#endif // QTMATERIALICONBUTTON_H
|