KShare/cropeditor/drawing/lineitem.cpp
2017-04-29 23:20:08 +02:00

29 lines
504 B
C++

#include "lineitem.hpp"
LineItem::LineItem()
{
}
LineItem::~LineItem()
{
delete path;
}
void LineItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene)
{
if (path == nullptr)
{
path = new QPainterPath(e->scenePos());
pathItem = scene->addPath(*path, scene->pen(), scene->brush());
}
else
{
path->lineTo(e->scenePos());
pathItem->setPath(*path);
}
}
void LineItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *)
{
}