def contextMenuEvent(self, event):
     if self.shapeItem.path().contains(event.pos()):
         return QGraphicsObject.contextMenuEvent(self, event)
     else:
         event.ignore()
Example #2
0
 def contextMenuEvent(self, event):
     if self.shapeItem.path().contains(event.pos()):
         return QGraphicsObject.contextMenuEvent(self, event)
     else:
         event.ignore()