-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphicscene.h
30 lines (27 loc) · 902 Bytes
/
graphicscene.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
#ifndef GRAPHICSCENE_H
#define GRAPHICSCENE_H
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsScene>
#include <QPoint>
#include <QPointF>
#include "graphicslayer.h"
class GraphicScene : public QGraphicsScene
{
Q_OBJECT
int numberOfLayers;
QVector<GraphicsLayer*> layers;
public:
GraphicScene();
explicit GraphicScene(int _numberOfLayers);
void setItemLayer(QGraphicsItem* item, int layer);
void removeItemFromLayers(QGraphicsItem* item);
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
void wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) override;
void keyPressEvent(QKeyEvent* keyEvent) override;
signals:
void mouseEventOccured(QGraphicsSceneMouseEvent *mouseEvent);
void wheelEventOccured(QGraphicsSceneWheelEvent *wheelEvent);
void keyPressEventOccured(QKeyEvent* keyEvent);
};
#endif // GRAPHICSCENE_H