-
Notifications
You must be signed in to change notification settings - Fork 0
/
provariquadro.h
64 lines (58 loc) · 1.94 KB
/
provariquadro.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
63
64
#ifndef PROVARIQUADRO_H
#define PROVARIQUADRO_H
#include <QPainter>
#include <QGraphicsItem>
#include <QGraphicsScene> // ???
#include <QPointer>
#include "handleitem.h"
#include "arrow.h"
//class Arrow;
class HandleItem;
class ProvaRiquadro : public QGraphicsObject
{
Q_OBJECT
public:
enum { ProvaRiquadro_type = UserType + 1 };
int type() const
{// Enable the use of qgraphicsitem_cast with this item.
return ProvaRiquadro_type;
}
ProvaRiquadro();
void setLayer(int i);
QRectF boundingRect() const;
QRectF rect();
void setArrowTarget(); //serve per deselezionare quando viene rilasciato dal click crea arrow.
void setRect(QRectF rect);
QGraphicsTextItem * text;
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
std::map<ProvaRiquadro*,/* QGraphicsLineItem**/ Arrow* > starting_lines,arriving_lines;
// void update_lines();
void erase_lines();
void redraw_lines();
//stores the points where the arriving lines start (starting_points), and where the starting lines arrive (arriving_points)
// void setFocus(bool value);
signals:
void riquadroCliccatoSx();
void riquadroCliccatoDx();
void riquadroMosso();
void riquadroDoubleClick();
public slots:
void provaselected();
protected:
// virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
void advance();
private:
/* HandleItem* topHandle;
HandleItem* rightHandle;
HandleItem* leftHandle;
HandleItem* bottomHandle;
HandleItem* centerHandle;
*/ QBrush brush;
QRectF rekt;
bool being_moved, arrow_target;
};
#endif // PROVARIQUADRO_H