KShare/cropeditor/drawing/pathitem.cpp

18 lines
489 B
C++
Raw Normal View History

2017-05-01 18:43:54 +02:00
#include "pathitem.hpp"
2017-05-06 13:21:12 +02:00
PathItem::PathItem() {}
2017-05-01 18:43:54 +02:00
2017-05-06 13:21:12 +02:00
PathItem::~PathItem() { delete path; }
2017-05-01 18:43:54 +02:00
2017-05-06 13:21:12 +02:00
void PathItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) {
if (path == nullptr) {
path = new QPainterPath(e->scenePos());
pathItem = scene->addPath(*path, scene->pen(), scene->brush());
} else {
path->quadTo(path->currentPosition(), e->scenePos());
pathItem->setPath(*path);
}
2017-05-01 18:43:54 +02:00
}
2017-05-06 13:21:12 +02:00
void PathItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) {}