I am trying to connect to the mouse-enter event of QGraphicsItems that are placed onto a QGraphicsScene and visualized through a QGraphicsView. From what I understand, the method to override for this is dragEnterEvent/hoverEnterEvent in a class derived from QGraphicsItem (or one of it's subclasses). My attempt looks like this:
Qt Code:
  1. class StaPoly(QtGui.QGraphicsPolygonItem):
  2.  
  3. def __init__(self,*args):
  4. QtGui.QGraphicsPolygonItem.__init__(self,*args)
  5. self.setAcceptDrops(True)
  6. self.setAcceptHoverEvents(True)
  7. self.setEnabled(True)
  8. self.setActive(True)
  9.  
  10. def mouseMoveEvent(self,event):
  11. print "Enter!"
  12.  
  13. def hoverEnterEvent(self,event):
  14. print "Enter!" ...
  15.  
  16. ...
  17.  
  18. def draw(self):
  19. p = self.parent
  20.  
  21. self.group = QtGui.QGraphicsItemGroup(scene=p.scene)
  22.  
  23. ...
  24. for xpix in lons:
  25. poly = QtGui.QPolygonF()
  26. poly << QtCore.QPointF(xpix-symw,ypix)
  27. poly << QtCore.QPointF(xpix,ypix+symh)
  28. poly << QtCore.QPointF(xpix+symw,ypix)
  29. poly << QtCore.QPointF(xpix,ypix-symh)
  30.  
  31. item = StaPoly(poly)
  32. item.setPen(QtGui.QColor(color))
  33. item.setBrush(QtGui.QColor(color))
  34. self.group.addToGroup(item)
To copy to clipboard, switch view to plain text mode 

I hope the above snippets make it clear what I am trying to do. Note that the display is generated exactly as I desire, no issue there - however the polygons that get drawn are not responding to the enter-event - I am not seeing any evidence that dragEnterEvent() is being called.

Note that I am also setting up the GraphicsView to receive events as-well like this, and these mouse move events *are* being received OK:

Qt Code:
  1. class MyView(QtGui.QGraphicsView):
  2.  
  3. def __init__(self):
  4. QtGui.QGraphicsView.__init__(self)
  5. self.scene = QtGui.QGraphicsScene()
  6. self.setScene(self.scene)
  7. self.setMouseTracking(True)
  8. self.setInteractive(False)
  9.  
  10. ...
  11.  
  12. def mouseMoveEvent(self,event):
  13.  
  14. ...
To copy to clipboard, switch view to plain text mode 

Any advice on how to make this work?