canvas.h 413 B

12345678910111213141516171819202122232425
  1. #ifndef __CANVAS_H__
  2. #define __CANVAS_H__
  3. #include <QWidget>
  4. class Canvas : public QWidget
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit Canvas( QWidget *parent = nullptr);
  9. ~Canvas();
  10. const QColor &backgroundColor() const;
  11. void setBackgroundColor(const QColor &newBackgroundColor);
  12. protected:
  13. void paintEvent(QPaintEvent *event) override;
  14. private:
  15. QColor m_backgroundColor;
  16. };
  17. #endif // CANVAS_H