KShare/cropeditor/drawing/lineitem.cpp

23 lines
414 B
C++
Raw Normal View History

2017-04-29 23:00:32 +02:00
#include "lineitem.hpp"
LineItem::LineItem()
{
}
2017-04-29 23:20:08 +02:00
void LineItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene)
2017-04-29 23:00:32 +02:00
{
2017-05-01 18:43:54 +02:00
if (init.isNull())
2017-04-29 23:20:08 +02:00
{
2017-05-01 18:43:54 +02:00
init = e->scenePos();
line = scene->addLine(QLineF(init, init), scene->pen());
2017-04-29 23:20:08 +02:00
}
2017-04-29 23:00:32 +02:00
else
2017-04-29 23:20:08 +02:00
{
2017-05-01 18:43:54 +02:00
line->setLine(QLineF(init, e->scenePos()));
2017-04-29 23:20:08 +02:00
}
2017-04-29 23:00:32 +02:00
}
2017-04-29 23:20:08 +02:00
void LineItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *)
2017-04-29 23:00:32 +02:00
{
}