diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index 190a40d3c..659f4ec96 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -303,9 +303,10 @@ void VToolArc::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index fd513ae21..241f9b79c 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -281,9 +281,10 @@ void VToolArcWithLength::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolArcWithLength::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index 71cd2547c..94a68fafb 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -193,9 +193,10 @@ void VToolCubicBezier::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezier::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp index a8b0a6601..306aa1321 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp @@ -181,9 +181,10 @@ void VToolCubicBezierPath::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolCubicBezierPath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index 29ae8a164..5aebc6070 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -366,9 +366,10 @@ void VToolEllipticalArc::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolEllipticalArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index b195cd143..a9cebcb89 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -545,9 +545,10 @@ void VToolSpline::RefreshCtrlPoints() //--------------------------------------------------------------------------------------------------------------------- void VToolSpline::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 025481e46..8cede3b33 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -278,9 +278,10 @@ void VToolSplinePath::EnableToolMove(bool move) //--------------------------------------------------------------------------------------------------------------------- void VToolSplinePath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) { diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index c2169c25c..548c6de59 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -110,7 +110,7 @@ protected: virtual void ChangeLabelVisibility(quint32 id, bool visible); template - void ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemId, + void ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemId = NULL_ID, const RemoveOption &showRemove = RemoveOption::Enable, const Referens &ref = Referens::Follow); @@ -151,7 +151,14 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI QAction *actionShowLabel = menu.addAction(tr("Show label")); actionShowLabel->setCheckable(true); - actionShowLabel->setChecked(IsLabelVisible(itemId)); + if (itemId != NULL_ID) + { + actionShowLabel->setChecked(IsLabelVisible(itemId)); + } + else + { + actionShowLabel->setVisible(false); + } QAction *actionRemove = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete")); if (showRemove == RemoveOption::Enable) diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index a86f4ba20..a2bc22acb 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -252,9 +252,10 @@ void VToolLine::AllowSelecting(bool enabled) //--------------------------------------------------------------------------------------------------------------------- void VToolLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id) { + Q_UNUSED(id) try { - ContextMenu(event, id); + ContextMenu(event); } catch(const VExceptionToolWasDeleted &e) {