class_docstr: Abstract ParameterTree item. 
  Used to represent the state of a Parameter from within a ParameterTree.
  
    - Sets first column of item to name
    - generates context menu if item is renamable or removable
    - handles child added / removed events
    - provides virtual functions for handling changes from parameter
  
  For more ParameterItem types, see ParameterTree.parameterTypes module.
class_docstr_tok: ["Abstract","ParameterTree","item",".","Used","to","represent","the","state","of","a","Parameter","from","within","a","ParameterTree",".","-","Sets","first","column","of","item","to","name","-","generates","context","menu","if","item","is","renamable","or","removable","-","handles","child","added","\/","removed","events","-","provides","virtual","functions","for","handling","changes","from","parameter","For","more","ParameterItem","types",",","see","ParameterTree.parameterTypes","module","."]
code: def contextMenuEvent(self, ev):
      opts = self.param.opts
  
      if (
          not opts.get("removable", False)
          and not opts.get("renamable", False)
          and "context" not in opts
      ):
          return
  
      ## Generate context menu for renaming/removing parameter
      self.contextMenu = (
          QtWidgets.QMenu()
      )  # Put in global name space to prevent garbage collection
      self.contextMenu.addSeparator()
      if opts.get("renamable", False):
          self.contextMenu.addAction(
              translate("ParameterItem", "Rename")
          ).triggered.connect(self.editName)
      if opts.get("removable", False):
          self.contextMenu.addAction(
              translate("ParameterItem", "Remove")
          ).triggered.connect(self.requestRemove)
  
      # context menu
      context = opts.get("context", None)
      if isinstance(context, list):
          for name in context:
              self.contextMenu.addAction(name).triggered.connect(
                  self.contextMenuTriggered(name)
              )
      elif isinstance(context, dict):
          for name, title in context.items():
              self.contextMenu.addAction(title).triggered.connect(
                  self.contextMenuTriggered(name)
              )
  
      self.contextMenu.popup(ev.globalPos())
  
imports: from ..Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 11 for calling the ParameterItem obj's underlying member method code with example usage: obj.contextMenuEvent(ev) without return types