Show context menu VSimplePoint and VSimpleCurve.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-05-25 11:43:36 +03:00
parent 8d373f91af
commit 1d059ca9a5
4 changed files with 14 additions and 0 deletions

View File

@ -149,6 +149,12 @@ QVariant VSimpleCurve::itemChange(QGraphicsItem::GraphicsItemChange change, cons
return QGraphicsPathItem::itemChange(change, value);
}
//---------------------------------------------------------------------------------------------------------------------
void VSimpleCurve::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
emit ShowContextMenu(event);
}
//---------------------------------------------------------------------------------------------------------------------
void VSimpleCurve::ShowPath()
{

View File

@ -69,6 +69,7 @@ protected:
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(VSimpleCurve)

View File

@ -263,3 +263,9 @@ QVariant VSimplePoint::itemChange(QGraphicsItem::GraphicsItemChange change, cons
return QGraphicsEllipseItem::itemChange(change, value);
}
//---------------------------------------------------------------------------------------------------------------------
void VSimplePoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
emit ShowContextMenu(event);
}

View File

@ -80,6 +80,7 @@ protected:
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
virtual void keyReleaseEvent ( QKeyEvent * event ) Q_DECL_OVERRIDE;
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(VSimplePoint)