blob: 91b3f63a6802c9fe010b1e5d169fcb09982b078a (
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
33
|
/*!
* 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 *);
QPainterPath shape() const override;
QRectF boundingRect() const override;
void updateBounds();
Node *node() const;
private:
Node *_node;
QRectF labelRect() const;
QRectF _boundingRect;
};
#endif // NODEITEM_H
|