Refactoring. Removed dublicate public slot. We can use method contextMenuEvent
instead. --HG-- branch : develop
This commit is contained in:
parent
8b008e8513
commit
7834647208
|
@ -107,16 +107,6 @@ void VToolAlongLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||
ContextMenu<DialogAlongLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu handle context menu event.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolAlongLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogAlongLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief RemoveReferens decrement value of reference.
|
||||
|
|
|
@ -59,7 +59,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void RemoveReferens();
|
||||
|
|
|
@ -251,16 +251,6 @@ void VToolBisector::SetFactor(qreal factor)
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolBisector::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogBisector>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -66,7 +66,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void RemoveReferens();
|
||||
|
|
|
@ -271,12 +271,6 @@ void VToolCurveIntersectAxis::FullUpdateFromFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCurveIntersectAxis::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCurveIntersectAxis>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCurveIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
|
|
|
@ -64,7 +64,6 @@ public:
|
|||
virtual void ShowVisualization(bool show);
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -245,16 +245,6 @@ void VToolCutArc::CurveChoosed(quint32 id)
|
|||
emit ChoosedTool(id, SceneObject::Arc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolCutArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutArc>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -54,7 +54,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void CurveChoosed(quint32 id);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -258,16 +258,6 @@ void VToolCutSpline::CurveChoosed(quint32 id)
|
|||
emit ChoosedTool(id, SceneObject::Spline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolCutSpline::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutSpline>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -56,7 +56,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void CurveChoosed(quint32 id);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -303,16 +303,6 @@ void VToolCutSplinePath::CurveChoosed(quint32 id)
|
|||
emit ChoosedTool(id, SceneObject::SplinePath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolCutSplinePath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutSplinePath>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -57,7 +57,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void CurveChoosed(quint32 id);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -211,16 +211,6 @@ void VToolEndLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||
ContextMenu<DialogEndLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolEndLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogEndLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief SaveDialog save options into file after change in dialog.
|
||||
|
|
|
@ -59,7 +59,6 @@ public:
|
|||
virtual void ShowVisualization(bool show);
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -211,16 +211,6 @@ void VToolHeight::FullUpdateFromFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolHeight::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogHeight>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -62,7 +62,6 @@ public:
|
|||
virtual void ShowVisualization(bool show);
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -219,16 +219,6 @@ void VToolLineIntersect::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolLineIntersect::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogLineIntersect>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -67,7 +67,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void RemoveReferens();
|
||||
|
|
|
@ -285,12 +285,6 @@ void VToolLineIntersectAxis::FullUpdateFromFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersectAxis::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogLineIntersectAxis>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,6 @@ public:
|
|||
virtual void ShowVisualization(bool show);
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void SaveDialog(QDomElement &domElement);
|
||||
|
|
|
@ -229,16 +229,6 @@ void VToolNormal::SetFactor(qreal factor)
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolNormal::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogNormal>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -61,7 +61,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void RemoveReferens();
|
||||
|
|
|
@ -52,7 +52,7 @@ VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsIte
|
|||
{
|
||||
radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm);
|
||||
namePoint = new VGraphicsSimpleTextItem(this);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::contextMenuEvent);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolPoint::DeleteFromLabel);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::PointChoosed, this, &VToolPoint::PointChoosed);
|
||||
lineName = new QGraphicsLineItem(this);
|
||||
|
@ -172,16 +172,6 @@ void VToolPoint::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::Disable(bool disable)
|
||||
{
|
||||
|
@ -346,6 +336,12 @@ void VToolPoint::keyReleaseEvent(QKeyEvent *event)
|
|||
QGraphicsEllipseItem::keyReleaseEvent ( event );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::setEnabled(bool enabled)
|
||||
{
|
||||
|
|
|
@ -56,7 +56,6 @@ public slots:
|
|||
virtual void ChangedActivDraw(const QString &newName);
|
||||
virtual void ShowTool(quint32 id, bool enable);
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
void Disable(bool disable);
|
||||
void DeleteFromLabel();
|
||||
virtual void EnableToolMove(bool move);
|
||||
|
@ -79,6 +78,7 @@ protected:
|
|||
void RefreshLine();
|
||||
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
|
||||
virtual void keyReleaseEvent(QKeyEvent * event);
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
private:
|
||||
Q_DISABLE_COPY(VToolPoint)
|
||||
};
|
||||
|
|
|
@ -271,16 +271,6 @@ void VToolPointOfContact::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolPointOfContact::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogPointOfContact>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -72,7 +72,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void RemoveReferens();
|
||||
|
|
|
@ -178,16 +178,6 @@ void VToolPointOfIntersection::FullUpdateFromFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolPointOfIntersection::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogPointOfIntersection>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief RemoveReferens decrement value of reference.
|
||||
|
|
|
@ -61,7 +61,6 @@ public:
|
|||
virtual void ShowVisualization(bool show);
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void RemoveReferens();
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
|
|
|
@ -255,16 +255,6 @@ void VToolShoulderPoint::SetFactor(qreal factor)
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolShoulderPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogShoulderPoint>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief contextMenuEvent handle context menu events.
|
||||
|
|
|
@ -65,7 +65,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void RemoveReferens();
|
||||
|
|
|
@ -329,23 +329,6 @@ void VToolSinglePoint::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*(VAbstractTool::data.GeometricObject<VPointF>(id)));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolSinglePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
if (doc->CountPP() > 1)
|
||||
{
|
||||
ContextMenu<DialogSinglePoint>(this, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
ContextMenu<DialogSinglePoint>(this, event, false);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::EnableToolMove(bool move)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,6 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
virtual void EnableToolMove(bool move);
|
||||
signals:
|
||||
/**
|
||||
|
|
|
@ -235,16 +235,6 @@ void VToolTriangle::FullUpdateFromFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowContextMenu show context menu.
|
||||
* @param event context menu event.
|
||||
*/
|
||||
void VToolTriangle::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogTriangle>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief RemoveReferens decrement value of reference.
|
||||
|
|
|
@ -69,7 +69,6 @@ public:
|
|||
virtual void ShowVisualization(bool show);
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
virtual void RemoveReferens();
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
|
|
Loading…
Reference in New Issue
Block a user