diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-01-04 16:00:52 +0100 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-01-04 16:00:52 +0100 |
commit | 738ecbd5fad2b46836bfd6a94aeebf165ae2bbca (patch) | |
tree | df04709807cc9ec8481a3ebc7d80ac25e5b2f457 /src/gui/nodeitem.h | |
parent | 0421a96749743868554d44585050b1b3d04864d2 (diff) |
relocated source code to the root
Diffstat (limited to 'src/gui/nodeitem.h')
-rw-r--r-- | src/gui/nodeitem.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/nodeitem.h b/src/gui/nodeitem.h new file mode 100644 index 0000000..9a3edb0 --- /dev/null +++ b/src/gui/nodeitem.h @@ -0,0 +1,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 |