-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrossRect.h
More file actions
34 lines (28 loc) · 896 Bytes
/
crossRect.h
File metadata and controls
34 lines (28 loc) · 896 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
29
30
31
32
33
34
#ifndef CHIP_H
#define CHIP_H
#include <QColor>
#include <QGraphicsItem>
class Chip : public QGraphicsItem
{
public:
Chip(int id, int offCars, int arrCars, int maxArr, int minArr, int maxOff, int minOff, int colorType);
QRectF boundingRect() const override;
QPainterPath shape() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
void setToolTip();
private:
int id;
int offCars;
int arrCars;
int curColorType;
int defaultColorType;
QColor arrColor;
QColor offColor;
QColor color;
QVector<QPointF> stuff;
};
#endif // CHIP_H