blob: 9a3edb01f8d2927189f9a74a8fdeee077c0c79d9 (
plain)
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
|
/**
* A QGraphicsItem that handles drawing a single node.
*/
#ifndef NODEITEM_H
#define NODEITEM_H
#include "node.h"
#include <QObject>
#include <QGraphicsItem>
#include <QPainterPath>
#include <QRectF>
class NodeItem : public QGraphicsItem
{
public:
NodeItem(Node *node);
void readPos();
void writePos();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
QPainterPath shape() const;
QRectF boundingRect() const;
Node *node() const;
private:
Node *_node;
QRectF labelRect() const;
};
#endif // NODEITEM_H
|