code: def contextMenuEvent(self, event):
          
          contextMenu = QtWidgets.QMenu()
          for action in self.actions():
              contextMenu.addAction(action)
          contextMenu.exec_(event.screenPos())
docs: Shows the context menu at the cursor position
  
              We need to take the event-based approach because ArgosPgPlotItem does derives from
              QGraphicsWidget, and not from QWidget, and therefore doesn't have the
              customContextMenuRequested signal.