Hello,

all is in the title.
I have subclassed a QGraphicsPolygonItem,
- when ItemIsMovable==True, my context menu appears, as expected.
- if i disable the flag, context menu does not appear anymore.

My program is quite long and complicated, but here are the lines involved :
Qt Code:
  1. class NGraphicsCloisonItem(QtGui.QGraphicsPolygonItem):
  2. Type = QtGui.QGraphicsItem.UserType + 6
  3.  
  4. def __init__(self, **dump):
  5.  
  6. [...]
  7. super(NGraphicsCloisonItem, self).__init__(self.model.qpolygon, parent=parentitem)
  8.  
  9. [...]
  10. self.setVisible(True)
  11. self.setFlag(QtGui.QGraphicsItem.ItemIsMovable, False)
  12. self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable, True)
  13. [...]
To copy to clipboard, switch view to plain text mode 

and in the scene :

Qt Code:
  1. def contextMenuEvent(self,event):
  2. menu = someMenuThatWorksWhenMovable
  3. for action in someListOfActions :
  4. for view in self.views():
  5. view.addAction(action)
  6. menu.exec_(event.screenPos())
To copy to clipboard, switch view to plain text mode 

Thank you for your answer.