Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
.
[graphlib.git] / DrawingArea.h
index 76d03ef..874de0f 100644 (file)
@@ -1,18 +1,18 @@
 #ifndef DRAWING_AREA_H
 #define DRAWING_AREA_H
 
-#include <DrawingAreaInterface.h>
-
 #include <QColor>
 #include <QImage>
+#include <QObject>
 #include <QPainter>
 
-class DrawingArea: public DrawingAreaInterface {
-private:
-    QImage *image;
-    QPainter *painter;
+class DrawingArea: public QObject {
+    Q_OBJECT
 
 public:
+    static const int DEFAULT_WIDTH = 640;
+    static const int DEFAULT_HEIGHT = 480;
+
     DrawingArea(int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
     ~DrawingArea();
 
@@ -25,6 +25,15 @@ public:
     void drawPoint(int x, int y);
     void drawLine(int x1, int y1, int x2, int y2);
 
+    const QImage &getImage() const;
+
+signals:
+    void update();
+
+private:
+    QImage *image;
+    QPainter *painter;
+
 };
 
 #endif // !DRAWING_AREA_H