equal
deleted
inserted
replaced
1 #ifndef DRAWMAPSCENE_H |
1 #ifndef DRAWMAPSCENE_H |
2 #define DRAWMAPSCENE_H |
2 #define DRAWMAPSCENE_H |
3 |
3 |
4 #include <QGraphicsScene> |
4 #include <QGraphicsScene> |
|
5 #include <QPainterPath> |
5 |
6 |
6 class QGraphicsPathItem; |
7 class QGraphicsPathItem; |
7 |
8 |
8 typedef QList<QList<QPoint> > Paths; |
9 typedef QList<QList<QPoint> > Paths; |
9 |
10 |
12 Q_OBJECT |
13 Q_OBJECT |
13 public: |
14 public: |
14 explicit DrawMapScene(QObject *parent = 0); |
15 explicit DrawMapScene(QObject *parent = 0); |
15 |
16 |
16 QByteArray encode(); |
17 QByteArray encode(); |
|
18 void decode(QByteArray data); |
17 |
19 |
18 signals: |
20 signals: |
19 void pathChanged(); |
21 void pathChanged(); |
20 |
22 |
21 public slots: |
23 public slots: |
29 Paths paths; |
31 Paths paths; |
30 |
32 |
31 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent); |
33 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent); |
32 virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent); |
34 virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent); |
33 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent); |
35 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent); |
|
36 |
|
37 QPainterPath pointsToPath(const QList<QPoint> points); |
34 }; |
38 }; |
35 |
39 |
36 #endif // DRAWMAPSCENE_H |
40 #endif // DRAWMAPSCENE_H |