4423
|
1 |
#ifndef DRAWMAPSCENE_H
|
|
2 |
#define DRAWMAPSCENE_H
|
|
3 |
|
|
4 |
#include <QGraphicsScene>
|
|
5 |
|
4426
|
6 |
class QGraphicsPathItem;
|
|
7 |
|
4427
|
8 |
typedef QList<QList<QPoint> > Paths;
|
|
9 |
|
4423
|
10 |
class DrawMapScene : public QGraphicsScene
|
|
11 |
{
|
|
12 |
Q_OBJECT
|
|
13 |
public:
|
|
14 |
explicit DrawMapScene(QObject *parent = 0);
|
|
15 |
|
4427
|
16 |
QByteArray encode();
|
|
17 |
|
4423
|
18 |
signals:
|
4427
|
19 |
void pathChanged();
|
4423
|
20 |
|
|
21 |
public slots:
|
4426
|
22 |
void undo();
|
4423
|
23 |
|
|
24 |
private:
|
4424
|
25 |
QPen m_pen;
|
|
26 |
QBrush m_brush;
|
4426
|
27 |
QGraphicsPathItem * m_currPath;
|
4427
|
28 |
Paths paths;
|
4424
|
29 |
|
4423
|
30 |
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
|
|
31 |
virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
|
|
32 |
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
|
|
33 |
};
|
|
34 |
|
|
35 |
#endif // DRAWMAPSCENE_H
|