Advertisement
bilaljalok

Canvas.h

Mar 20th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef CANVAS_H
  2. #define CANVAS_H
  3.  
  4. #include <QObject>
  5. #include <QWidget>
  6. #include <QPaintEvent>
  7. #include <QMouseEvent>
  8. #include <QResizeEvent>
  9. #include <QPoint>
  10. #include <QPainterPath>
  11.  
  12.  
  13. class Canvas : public QWidget
  14. {
  15.     Q_OBJECT
  16. public:
  17.     explicit Canvas(QWidget *parent = 0);
  18.  
  19. signals:
  20.  
  21. public slots:
  22.     void colorBox();
  23.     void backGround();
  24.     void drawRectangle();
  25.     void drawEllipse();
  26.     void drawPoly();
  27.     void drawLine();
  28.     void Save();
  29. private:
  30.     QVector<QPointF> m_points;
  31.     QImage image;
  32.     void UpdateImage();
  33.     QColor color;
  34.  
  35. //    void drawPolygon();
  36.  
  37.     QPointF P1;
  38.     QPointF P2;
  39.     QString set="Draw Poly";
  40.     QColor Background=Qt::white;
  41.  
  42.     QPainterPath path;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement