How to show a pop up menu in Qt while right clicking the QGraphicsView? Please help
QGraphicsView
is derived from QWidget
, so just reimplement contextMenuEvent(QContextMenuEvent* event)
to spawn a QMenu
. If you want one to appear when right-clicking on QGraphicsItems
in the view, then you will have to reimplement contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
in the items.