Issue #274 Add The Curve options dialog box.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-04-22 16:13:13 +03:00
parent 6d436675e4
commit 8b008e8513
4 changed files with 16 additions and 0 deletions

View File

@ -71,6 +71,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr
&VToolSpline::ControlPointChangePosition);
connect(this, &VToolSpline::RefreshLine, controlPoint1, &VControlPointSpline::RefreshLine);
connect(this, &VToolSpline::setEnabledPoint, controlPoint1, &VControlPointSpline::setEnabledPoint);
connect(controlPoint1, &VControlPointSpline::ShowContextMenu, this, &VToolSpline::contextMenuEvent);
controlPoints.append(controlPoint1);
VControlPointSpline *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, spl->GetP3(),
@ -79,6 +80,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr
&VToolSpline::ControlPointChangePosition);
connect(this, &VToolSpline::RefreshLine, controlPoint2, &VControlPointSpline::RefreshLine);
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
connect(controlPoint2, &VControlPointSpline::ShowContextMenu, this, &VToolSpline::contextMenuEvent);
controlPoints.append(controlPoint2);
ShowFoot(false);

View File

@ -72,6 +72,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co
&VToolSplinePath::ControlPointChangePosition);
connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine);
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
connect(controlPoint, &VControlPointSpline::ShowContextMenu, this, &VToolSplinePath::contextMenuEvent);
controlPoints.append(controlPoint);
controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, spl.GetP3(), spl.GetP4().toQPointF(),
@ -80,6 +81,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co
&VToolSplinePath::ControlPointChangePosition);
connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine);
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
connect(controlPoint, &VControlPointSpline::ShowContextMenu, this, &VToolSplinePath::contextMenuEvent);
controlPoints.append(controlPoint);
}

View File

@ -142,6 +142,12 @@ void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
QGraphicsEllipseItem::mouseReleaseEvent(event);
}
//---------------------------------------------------------------------------------------------------------------------
void VControlPointSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
emit ShowContextMenu(event);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief RefreshLine refresh line control point.

View File

@ -54,6 +54,11 @@ signals:
*/
void ControlPointChangePosition(const qint32 &indexSpline, SplinePointPosition position,
const QPointF &pos);
/**
* @brief ShowContextMenu emit when need show tool's context menu.
* @param event context menu event.
*/
void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
public slots:
void RefreshLine(const qint32 &indexSpline, SplinePointPosition pos, const QPointF &controlPoint,
const QPointF &splinePoint);
@ -70,6 +75,7 @@ protected:
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent *event );
private:
Q_DISABLE_COPY(VControlPointSpline)
/** @brief indexSpline index spline in list.. */