-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphics.h
More file actions
29 lines (21 loc) · 728 Bytes
/
graphics.h
File metadata and controls
29 lines (21 loc) · 728 Bytes
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
#ifndef GRAPHICS
#define GRAPHICS
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsSceneMouseEvent>
using namespace std;
class MScene: public QGraphicsScene{
public:
MScene(QObject* parent = 0): QGraphicsScene(parent){}
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent); // TODO
};
class MPixmapItem: public QGraphicsPixmapItem{
public:
MPixmapItem(QGraphicsItem* parent = 0): QGraphicsPixmapItem(parent){}
MPixmapItem(const QPixmap& pixmap, QGraphicsItem* parent = 0): QGraphicsPixmapItem(pixmap, parent){}
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event);
};
#endif // GRAPHICS