Simple curve ignore press event and allow move curve by mouse.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-02-12 18:10:47 +02:00
parent 0deaa1b7b4
commit 99ebbc3ed9
4 changed files with 14 additions and 0 deletions

View File

@ -204,6 +204,12 @@ void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, cons
qApp->getUndoStack()->push(moveSplPath);
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSplinePath::EnableToolMove(bool move)
{
this->setFlag(QGraphicsItem::ItemIsMovable, move);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief UpdateControlPoints update position points control points in file.

View File

@ -73,6 +73,7 @@ public slots:
void ControlPointChangePosition(const qint32 &indexSpline, const SplinePointPosition &position,
const QPointF &pos);
virtual void EnableToolMove(bool move);
protected:
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
virtual void RefreshDataInFile();

View File

@ -144,6 +144,12 @@ void VSimpleCurve::SetCurrentColor(const QColor &value)
setPen(QPen(CorrectColor(currentColor), pen().widthF()));
}
//---------------------------------------------------------------------------------------------------------------------
void VSimpleCurve::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
event->ignore();
}
//---------------------------------------------------------------------------------------------------------------------
QColor VSimpleCurve::CorrectColor(const QColor &color) const
{

View File

@ -60,6 +60,7 @@ signals:
void Choosed(quint32 id);
void HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction);
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );