qtmaterialiconbutton.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef QTMATERIALICONBUTTON_H
  2. #define QTMATERIALICONBUTTON_H
  3. #include <QtWidgets/QAbstractButton>
  4. class QtMaterialIconButtonPrivate;
  5. class QtMaterialIconButton : public QAbstractButton
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit QtMaterialIconButton(const QIcon &icon, QWidget *parent = 0);
  10. ~QtMaterialIconButton();
  11. QSize sizeHint() const Q_DECL_OVERRIDE;
  12. void setUseThemeColors(bool value);
  13. bool useThemeColors() const;
  14. void setColor(const QColor &color);
  15. QColor color() const;
  16. void setDisabledColor(const QColor &color);
  17. QColor disabledColor() const;
  18. protected:
  19. QtMaterialIconButton(QtMaterialIconButtonPrivate &d, QWidget *parent = 0);
  20. bool event(QEvent *event) Q_DECL_OVERRIDE;
  21. bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
  22. void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
  23. void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
  24. const QScopedPointer<QtMaterialIconButtonPrivate> d_ptr;
  25. private:
  26. Q_DISABLE_COPY(QtMaterialIconButton)
  27. Q_DECLARE_PRIVATE(QtMaterialIconButton)
  28. };
  29. #endif // QTMATERIALICONBUTTON_H