-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathoval.h
35 lines (28 loc) · 904 Bytes
/
oval.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 OVAL_H
#define OVAL_H
#include <QColor>
#include <QGraphicsItem>
#include "shape.h"
#include <QString>
class Oval : public Shape
{
public:
Oval(const QColor &color, int x, int y);
Oval(const QColor &color, int x, int y, QString text);
QRectF boundingRect() const Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
int type() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) Q_DECL_OVERRIDE;
int getID();
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;
//int UserType;
int iD;
};
#endif // OVAL_H