parent
6d436675e4
commit
8b008e8513
|
@ -71,6 +71,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const QStr
|
||||||
&VToolSpline::ControlPointChangePosition);
|
&VToolSpline::ControlPointChangePosition);
|
||||||
connect(this, &VToolSpline::RefreshLine, controlPoint1, &VControlPointSpline::RefreshLine);
|
connect(this, &VToolSpline::RefreshLine, controlPoint1, &VControlPointSpline::RefreshLine);
|
||||||
connect(this, &VToolSpline::setEnabledPoint, controlPoint1, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSpline::setEnabledPoint, controlPoint1, &VControlPointSpline::setEnabledPoint);
|
||||||
|
connect(controlPoint1, &VControlPointSpline::ShowContextMenu, this, &VToolSpline::contextMenuEvent);
|
||||||
controlPoints.append(controlPoint1);
|
controlPoints.append(controlPoint1);
|
||||||
|
|
||||||
VControlPointSpline *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, spl->GetP3(),
|
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);
|
&VToolSpline::ControlPointChangePosition);
|
||||||
connect(this, &VToolSpline::RefreshLine, controlPoint2, &VControlPointSpline::RefreshLine);
|
connect(this, &VToolSpline::RefreshLine, controlPoint2, &VControlPointSpline::RefreshLine);
|
||||||
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
||||||
|
connect(controlPoint2, &VControlPointSpline::ShowContextMenu, this, &VToolSpline::contextMenuEvent);
|
||||||
controlPoints.append(controlPoint2);
|
controlPoints.append(controlPoint2);
|
||||||
|
|
||||||
ShowFoot(false);
|
ShowFoot(false);
|
||||||
|
|
|
@ -72,6 +72,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
&VToolSplinePath::ControlPointChangePosition);
|
||||||
connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine);
|
connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine);
|
||||||
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
||||||
|
connect(controlPoint, &VControlPointSpline::ShowContextMenu, this, &VToolSplinePath::contextMenuEvent);
|
||||||
controlPoints.append(controlPoint);
|
controlPoints.append(controlPoint);
|
||||||
|
|
||||||
controlPoint = new VControlPointSpline(i, SplinePointPosition::LastPoint, spl.GetP3(), spl.GetP4().toQPointF(),
|
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);
|
&VToolSplinePath::ControlPointChangePosition);
|
||||||
connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine);
|
connect(this, &VToolSplinePath::RefreshLine, controlPoint, &VControlPointSpline::RefreshLine);
|
||||||
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
||||||
|
connect(controlPoint, &VControlPointSpline::ShowContextMenu, this, &VToolSplinePath::contextMenuEvent);
|
||||||
controlPoints.append(controlPoint);
|
controlPoints.append(controlPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,12 @@ void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
QGraphicsEllipseItem::mouseReleaseEvent(event);
|
QGraphicsEllipseItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VControlPointSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
|
{
|
||||||
|
emit ShowContextMenu(event);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief RefreshLine refresh line control point.
|
* @brief RefreshLine refresh line control point.
|
||||||
|
|
|
@ -54,6 +54,11 @@ signals:
|
||||||
*/
|
*/
|
||||||
void ControlPointChangePosition(const qint32 &indexSpline, SplinePointPosition position,
|
void ControlPointChangePosition(const qint32 &indexSpline, SplinePointPosition position,
|
||||||
const QPointF &pos);
|
const QPointF &pos);
|
||||||
|
/**
|
||||||
|
* @brief ShowContextMenu emit when need show tool's context menu.
|
||||||
|
* @param event context menu event.
|
||||||
|
*/
|
||||||
|
void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||||
public slots:
|
public slots:
|
||||||
void RefreshLine(const qint32 &indexSpline, SplinePointPosition pos, const QPointF &controlPoint,
|
void RefreshLine(const qint32 &indexSpline, SplinePointPosition pos, const QPointF &controlPoint,
|
||||||
const QPointF &splinePoint);
|
const QPointF &splinePoint);
|
||||||
|
@ -70,6 +75,7 @@ protected:
|
||||||
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
|
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
|
||||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event );
|
||||||
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
|
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
|
||||||
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent *event );
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VControlPointSpline)
|
Q_DISABLE_COPY(VControlPointSpline)
|
||||||
/** @brief indexSpline index spline in list.. */
|
/** @brief indexSpline index spline in list.. */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user