Hide Show label option for not point objects.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-09-20 10:28:49 +03:00
parent 7864ae9572
commit af1e01c243
9 changed files with 25 additions and 10 deletions

View file

@ -303,9 +303,10 @@ void VToolArc::ShowVisualization(bool show)
//---------------------------------------------------------------------------------------------------------------------
void VToolArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogArc>(event, id);
ContextMenu<DialogArc>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -281,9 +281,10 @@ void VToolArcWithLength::ShowVisualization(bool show)
//---------------------------------------------------------------------------------------------------------------------
void VToolArcWithLength::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogArcWithLength>(event, id);
ContextMenu<DialogArcWithLength>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -193,9 +193,10 @@ void VToolCubicBezier::ShowVisualization(bool show)
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogCubicBezier>(event, id);
ContextMenu<DialogCubicBezier>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -181,9 +181,10 @@ void VToolCubicBezierPath::ShowVisualization(bool show)
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogCubicBezierPath>(event, id);
ContextMenu<DialogCubicBezierPath>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -366,9 +366,10 @@ void VToolEllipticalArc::ShowVisualization(bool show)
//---------------------------------------------------------------------------------------------------------------------
void VToolEllipticalArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogEllipticalArc>(event, id);
ContextMenu<DialogEllipticalArc>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -545,9 +545,10 @@ void VToolSpline::RefreshCtrlPoints()
//---------------------------------------------------------------------------------------------------------------------
void VToolSpline::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogSpline>(event, id);
ContextMenu<DialogSpline>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -278,9 +278,10 @@ void VToolSplinePath::EnableToolMove(bool move)
//---------------------------------------------------------------------------------------------------------------------
void VToolSplinePath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogSplinePath>(event, id);
ContextMenu<DialogSplinePath>(event);
}
catch(const VExceptionToolWasDeleted &e)
{

View file

@ -110,7 +110,7 @@ protected:
virtual void ChangeLabelVisibility(quint32 id, bool visible);
template <typename Dialog>
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)

View file

@ -252,9 +252,10 @@ void VToolLine::AllowSelecting(bool enabled)
//---------------------------------------------------------------------------------------------------------------------
void VToolLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id)
{
Q_UNUSED(id)
try
{
ContextMenu<DialogLine>(event, id);
ContextMenu<DialogLine>(event);
}
catch(const VExceptionToolWasDeleted &e)
{