issue 826 improvement to be able to add
--HG-- branch : feature
This commit is contained in:
parent
67c0e7ed45
commit
597f021139
|
@ -146,6 +146,13 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GOType itemType = GOType::Unknown;
|
||||||
|
if(itemId != NULL_ID)
|
||||||
|
{
|
||||||
|
const auto obj = data.GetGObject(itemId);
|
||||||
|
itemType = obj->getType();
|
||||||
|
}
|
||||||
|
|
||||||
qCDebug(vTool, "Creating tool context menu.");
|
qCDebug(vTool, "Creating tool context menu.");
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *actionOption = menu.addAction(QIcon::fromTheme("preferences-other"), tr("Options"));
|
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"));
|
QAction *actionShowLabel = menu.addAction(tr("Show label"));
|
||||||
actionShowLabel->setCheckable(true);
|
actionShowLabel->setCheckable(true);
|
||||||
if (itemId != NULL_ID)
|
|
||||||
|
if (itemType == GOType::Point)
|
||||||
{
|
{
|
||||||
actionShowLabel->setChecked(IsLabelVisible(itemId));
|
actionShowLabel->setChecked(IsLabelVisible(itemId));
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ QVariant VSimpleCurve::itemChange(QGraphicsItem::GraphicsItemChange change, cons
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VSimpleCurve::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
void VSimpleCurve::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
emit ShowContextMenu(event);
|
emit ShowContextMenu(event, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user