-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotitem.h
59 lines (51 loc) · 1.62 KB
/
dotitem.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
#ifndef DOTITEM_H
#define DOTITEM_H
#include <QPainter>
#include <QGraphicsItem>
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#include <QRectF>
#define DATA_IS_DOT Qt::UserRole
class DotItem : public QGraphicsItem
{
public:
DotItem(qreal posx,qreal posy);
virtual QRectF boundingRect() const;
bool isSet();
void setDot();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QColor currentColor();
int resetDot();
int getSetNumber();
void setLineChain(QGraphicsPolygonItem *newLineChain, int scoreAmplification);
QGraphicsPolygonItem * getPolygonItem();
QGraphicsPolygonItem *getLineCHain();
void setBlocked(bool isBlocked);
bool isBlocked();
void moveDotItem(qreal posX,qreal posY);
void markDot();
int getScoreNumber();
void setHistoryScore(QString newHistoryScore);
QString getHistoryScore();
int polygonPaintedLevel();
void setPolygonPaintedLevel(int polPaintedLevel);
//static bool turn;
static int dotsCounter;
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
//void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
//void mousePressEvent(QGraphicsSceneMouseEvent *event);
private:
QColor color;
bool set;
bool blocked;
QGraphicsPolygonItem *lineChain;
QRectF dotBoundingRect;
int score;
int setNumber;
QString historyScore;
//bool active; //содержит полигон, который влияет на счет (незакрашенный)
int paintedLevel;
};
#endif // DOTITEM_H