1 /****************************************************************************
3 ** Copyright (C) 2006-2007 Trolltech ASA. All rights reserved.
5 ** This file is part of the example classes of the Qt Toolkit.
7 ** Licensees holding a valid Qt License Agreement may use this file in
8 ** accordance with the rights, responsibilities and obligations
9 ** contained therein. Please consult your licensing agreement or
10 ** contact sales@trolltech.com if any conditions of this licensing
11 ** agreement are not clear to you.
13 ** Further information about Qt licensing is available at:
14 ** http://www.trolltech.com/products/qt/licensing.html or by
15 ** contacting info@trolltech.com.
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 ****************************************************************************/
25 #include <QGraphicsItem>
28 #include <TDF_Label.hxx>
32 class QGraphicsSceneMouseEvent;
34 class Node : public QGraphicsItem
37 Node(GraphWidget *graphWidget);
39 void setFunction(const TDF_Label& func);
40 const TDF_Label& getFunction() const;
42 void addEdge(Edge *edge);
43 QList<Edge *> edges() const;
45 enum { Type = UserType + 1 };
46 int type() const { return Type; }
48 QRectF boundingRect() const;
49 QPainterPath shape() const;
50 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
53 QVariant itemChange(GraphicsItemChange change, const QVariant &value);
54 void mousePressEvent(QGraphicsSceneMouseEvent *event);
55 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
58 QList<Edge *> edgeList;