equal
deleted
inserted
replaced
19 #ifndef DRAWMAPSCENE_H |
19 #ifndef DRAWMAPSCENE_H |
20 #define DRAWMAPSCENE_H |
20 #define DRAWMAPSCENE_H |
21 |
21 |
22 #include <QGraphicsScene> |
22 #include <QGraphicsScene> |
23 #include <QPainterPath> |
23 #include <QPainterPath> |
|
24 #include <QGraphicsEllipseItem> |
24 |
25 |
25 class QGraphicsPathItem; |
26 class QGraphicsPathItem; |
26 |
27 |
27 struct PathParams |
28 struct PathParams |
28 { |
29 { |
48 public slots: |
49 public slots: |
49 void undo(); |
50 void undo(); |
50 void clearMap(); |
51 void clearMap(); |
51 void simplifyLast(); |
52 void simplifyLast(); |
52 void setErasing(bool erasing); |
53 void setErasing(bool erasing); |
|
54 void showCursor(); |
|
55 void hideCursor(); |
53 |
56 |
54 private: |
57 private: |
55 QPen m_pen; |
58 QPen m_pen; |
56 QBrush m_eraser; |
59 QBrush m_eraser; |
57 QBrush m_brush; |
60 QBrush m_brush; |
58 QGraphicsPathItem * m_currPath; |
61 QGraphicsPathItem * m_currPath; |
59 Paths paths; |
62 Paths paths; |
60 Paths oldPaths; |
63 Paths oldPaths; |
61 bool m_isErasing; |
64 bool m_isErasing; |
62 QList<QGraphicsItem *> oldItems; |
65 QList<QGraphicsItem *> oldItems; |
|
66 QGraphicsEllipseItem * m_cursor; |
|
67 bool m_isCursorShown; |
63 |
68 |
64 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent); |
69 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent); |
65 virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent); |
70 virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent); |
66 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent); |
71 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent); |
67 virtual void wheelEvent(QGraphicsSceneWheelEvent *); |
72 virtual void wheelEvent(QGraphicsSceneWheelEvent *); |