I'm working in a classic QgraphicsView / QGraphicsScene / QGraphicsItem framework. I'm declaring a context menu in the QgraphicsView:
self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.__contextMenu)
and then later on:
# ---------------------------------------------------------------------------
def __contextMenu(self, position):
""" """
# ----> Creating Context menu -----------------------------------
oTreeMenu = QtGui.QMenu()
etc ...
then in the QGraphicsItem instancing class I use the contextMenuEvent like the following:
# ---------------------------------------------------------------------------
def contextMenuEvent(self, event):
""" """
# ----> Creating Context menu -----------------------------------
oTreeMenu = QtGui.QMenu()
The problem being that the QGraphicsItem event is completely overriden by the QGraphicsView's. How should I proceed to get both of them ?