-
Notifications
You must be signed in to change notification settings - Fork 4
/
trap.h
30 lines (24 loc) · 795 Bytes
/
trap.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 TRAP_H
#define TRAP_H
#include <QColor>
#include <QGraphicsItem>
#include "shape.h"
class Trap : public Shape
{
public:
Trap(const QColor &color, int x, int y);
Trap(const QColor &color, int x, int y, QString text);
QRectF boundingRect() const Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) Q_DECL_OVERRIDE;
int type() const Q_DECL_OVERRIDE;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
private:
int x;
int y;
QVector<QPointF> stuff;
};
#endif // TRAP_H