#ifndef NODE_H #define NODE_H #include #include "edge.h" #include "graphwidget.h" class GraphWidget; /// @bug no signal when size change class Node : public QGraphicsTextItem { // Q_OBJECT public: Node(GraphWidget *graphWidget = 0); void addEdge(Edge *edge); QList edges() const; protected: QVariant itemChange(GraphicsItemChange change, const QVariant &value); void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: QList edgeList; GraphWidget *graph; bool active; QRectF m_rect; }; #endif // NODE_H