-
Notifications
You must be signed in to change notification settings - Fork 6
/
figure.h
62 lines (43 loc) · 1.1 KB
/
figure.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef FIGURE_H
#define FIGURE_H
#include <QObject>
#include <QGraphicsItem>
#include <QColor>
class Figure : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_PROPERTY(QPointF startPoint
READ startPoint WRITE setStartPoint
NOTIFY pointChanged)
Q_PROPERTY(QPointF endPoint
READ endPoint WRITE setEndPoint
NOTIFY pointChanged)
public:
explicit Figure(QPointF point, QObject *parent = 0);
~Figure();
QPointF startPoint() const;
QPointF endPoint() const;
void setStartPoint(const QPointF point);
void setEndPoint(const QPointF point, bool test= true);
static void countZero();
float perimeter;
QString name;
QColor shapeColor;
int LineWeight;
bool isFilled;
QString shapeTypeName;
QColor fillColor;
static int lCount;
static int rCount;
static int cCount;
static int tCount;
signals:
void pointChanged();
private:
QPointF m_startPoint;
QPointF m_endPoint;
QRectF boundingRect() const;
public slots:
void updateCircle();
};
#endif // FIGURE_H