summaryrefslogtreecommitdiffstats
path: root/interactioncanvas.h
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-05-17 19:19:38 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-05-17 19:19:38 +0200
commit2778d2d6c0821a7a1622ca4312416739525781be (patch)
tree8589cab180728a024b8bd29a01fd9a5e85e9bce4 /interactioncanvas.h
parent31eb4d5361026dad3107dc647ac7c3ff63f50c7b (diff)
downloadGUI_SS2015-2778d2d6c0821a7a1622ca4312416739525781be.tar.gz
GUI_SS2015-2778d2d6c0821a7a1622ca4312416739525781be.zip
Add different shapes for drawing
Diffstat (limited to 'interactioncanvas.h')
-rw-r--r--interactioncanvas.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/interactioncanvas.h b/interactioncanvas.h
index e380d47..397865d 100644
--- a/interactioncanvas.h
+++ b/interactioncanvas.h
@@ -9,14 +9,21 @@
#include <QPainter>
#include "line.h"
+#include "rectangle.h"
+#include "ellipse.h"
+#include "polygon.h"
class InteractionCanvas : public QLabel
{
public:
- InteractionCanvas();
+ InteractionCanvas(QWidget *parent);
~InteractionCanvas();
- // QWidget interface
+ void addLine();
+ void addRectangle();
+ void addEllipse();
+ void addPolygon();
+
protected:
void mouseMoveEvent(QMouseEvent *mouseEvent);
void mousePressEvent(QMouseEvent *mouseEvent);
@@ -26,14 +33,15 @@ protected:
private:
void changeSelectedLine(Line *newSelectedLine);
- QList<Line> m_Lines;
+ void addNewLine(Line *newLine);
+
+ QList<Line *> m_Lines;
Line *m_NewLine;
Line *m_SelectedLine;
QPoint m_MousePressPoint;
QPoint m_MouseReleasePoint;
QPoint m_LastMousePosition;
- // QWidget interface
protected:
void paintEvent(QPaintEvent *paintEvent);
};