diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2020-04-13 16:21:39 +0100 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2020-04-13 16:21:39 +0100 |
commit | 732499eead71b23a7ba551fe788b47a4cf45124e (patch) | |
tree | ac3a770f742a2ebc749afd273037ee60a326ed61 /src/gui/pathitem.h | |
parent | 6dda16a24dfe7cbd0d90b77c57f1cf789210feb5 (diff) |
adding and drawing paths works
Diffstat (limited to 'src/gui/pathitem.h')
-rw-r--r-- | src/gui/pathitem.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/pathitem.h b/src/gui/pathitem.h new file mode 100644 index 0000000..7dc9c80 --- /dev/null +++ b/src/gui/pathitem.h @@ -0,0 +1,28 @@ +#ifndef PATHITEM_H +#define PATHITEM_H + +#include "path.h" + +#include <QGraphicsItem> + +class PathItem : public QGraphicsItem +{ +public: + PathItem(Path *path); + void readPos(); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override; + + Path *path() const; + + QPainterPath painterPath() const; + void setPainterPath(const QPainterPath &painterPath); + + QRectF boundingRect() const override; + +private: + Path *_path; + QPainterPath _painterPath; + QRectF _boundingRect; +}; + +#endif // PATHITEM_H |