-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpitem.h
40 lines (32 loc) · 923 Bytes
/
pitem.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
#ifndef PITEM_H
#define PITEM_H
#include <QGraphicsItem>
#include <QList>
class Arc;
class GraphWidget;
class QGraphicsSceneMouseEvent;
class PItem : public QGraphicsItem
{
public:
PItem(GraphWidget *graphWidget, bool pt, char *lbl);
QList<Arc *> arcs() const;
enum { PType = UserType + 1 };
int type() const { return PType; }
QList<Arc *> arcList;
QPointF newPos;
GraphWidget *graph;
bool advance();
bool selected;
void addArc(Arc *arc);
bool PTYPE;
QGraphicsTextItem *name;
protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private:
int px;
int py;
};
#endif