-
Notifications
You must be signed in to change notification settings - Fork 0
/
canvas.h
35 lines (31 loc) · 935 Bytes
/
canvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef CANVAS_H
#define CANVAS_H
#include <QGraphicsScene>
namespace DG{
class ServerSocket;
class EventDespatcher;
}
class QGraphicsSceneMouseEvent;
class QGraphicsSceneWheelEvent;
namespace DG{
class Canvas : public QGraphicsScene{
Q_OBJECT
private:
ServerSocket* _socket;
EventDespatcher* _despatcher;
public:
explicit Canvas(QObject* parent = 0);
void setDespatcher(EventDespatcher* despatcher);
public:
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
virtual void wheelEvent(QGraphicsSceneWheelEvent* event);
virtual void keyPressEvent(QKeyEvent * keyEvent);
virtual void keyReleaseEvent(QKeyEvent * keyEvent);
public:
void setSocket(ServerSocket* socket);
};
}
#endif // CANVAS_H