tools/drawMapTest/drawmapscene.h
changeset 4427 c5193713055f
parent 4426 969e411c72aa
child 4434 34c305fbc63c
equal deleted inserted replaced
4426:969e411c72aa 4427:c5193713055f
     3 
     3 
     4 #include <QGraphicsScene>
     4 #include <QGraphicsScene>
     5 
     5 
     6 class QGraphicsPathItem;
     6 class QGraphicsPathItem;
     7 
     7 
       
     8 typedef QList<QList<QPoint> > Paths;
       
     9 
     8 class DrawMapScene : public QGraphicsScene
    10 class DrawMapScene : public QGraphicsScene
     9 {
    11 {
    10 Q_OBJECT
    12 Q_OBJECT
    11 public:
    13 public:
    12     explicit DrawMapScene(QObject *parent = 0);
    14     explicit DrawMapScene(QObject *parent = 0);
    13 
    15 
       
    16     QByteArray encode();
       
    17 
    14 signals:
    18 signals:
       
    19     void pathChanged();
    15 
    20 
    16 public slots:
    21 public slots:
    17     void undo();
    22     void undo();
    18 
    23 
    19 private:
    24 private:
    20     QPen m_pen;
    25     QPen m_pen;
    21     QBrush m_brush;
    26     QBrush m_brush;
    22     QGraphicsPathItem  * m_currPath;
    27     QGraphicsPathItem  * m_currPath;
       
    28     Paths paths;
    23 
    29 
    24     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
    30     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
    25     virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
    31     virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
    26     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
    32     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
    27 };
    33 };