-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsquare.h
More file actions
65 lines (46 loc) · 1.26 KB
/
square.h
File metadata and controls
65 lines (46 loc) · 1.26 KB
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
63
64
65
#ifndef SQUARE_H
#define SQUARE_H
#include <QColor>
#include <string>
#include <QtWidgets>
#include <QGraphicsItem>
#include "shape.h"
#include "view.h"
class View;
QT_BEGIN_NAMESPACE
class QLabel;
class QSlider;
class QToolButton;
class QListWidget;
QT_END_NAMESPACE
class Square : public Shape //, public QObject
{
//Q_OBJECT
public:
Square(const QColor &color, int x, int y);
Square(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;
//void editColor(Square *x, QColor);
//void popUpCombo();
//void setColor(int n);
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;
int colorIndex;
//QWidget *w;
//QHBoxLayout *t;
//QComboBox *combo1;
//QToolButton *b;
QVector<QPointF> stuff;
public Q_SLOTS:
//void setColor2(int);
//void setColor();
};
#endif // SQUARE_H