From 732499eead71b23a7ba551fe788b47a4cf45124e Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 13 Apr 2020 16:21:39 +0100 Subject: adding and drawing paths works --- src/gui/pathitem.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/gui/pathitem.h (limited to 'src/gui/pathitem.h') 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 + +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 -- cgit v1.2.3