diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index affc64300..ef611c385 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -146,6 +146,13 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI return; } + GOType itemType = GOType::Unknown; + if(itemId != NULL_ID) + { + const auto obj = data.GetGObject(itemId); + itemType = obj->getType(); + } + qCDebug(vTool, "Creating tool context menu."); QMenu menu; QAction *actionOption = menu.addAction(QIcon::fromTheme("preferences-other"), tr("Options")); @@ -193,10 +200,10 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI } } - QAction *actionShowLabel = menu.addAction(tr("Show label")); actionShowLabel->setCheckable(true); - if (itemId != NULL_ID) + + if (itemType == GOType::Point) { actionShowLabel->setChecked(IsLabelVisible(itemId)); } diff --git a/src/libs/vwidgets/vsimplecurve.cpp b/src/libs/vwidgets/vsimplecurve.cpp index 6f6f80bb7..570de348d 100644 --- a/src/libs/vwidgets/vsimplecurve.cpp +++ b/src/libs/vwidgets/vsimplecurve.cpp @@ -155,7 +155,7 @@ QVariant VSimpleCurve::itemChange(QGraphicsItem::GraphicsItemChange change, cons //--------------------------------------------------------------------------------------------------------------------- void VSimpleCurve::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { - emit ShowContextMenu(event); + emit ShowContextMenu(event, id); } //---------------------------------------------------------------------------------------------------------------------