I have a class derived from QGraphicsView
, which contains QGraphicsItem
-derived elements. I want these elements to change color whenever the mouse
Fixed it. I need to use setAcceptHoverEvents(true)
in the constructor of my QGraphicsItem
-derived class.
In my case, hover events wouldn't work if I overrode mouseMoveEvent in my implementation of the QGraphicsView class. I fixed this by adding a call to
QGraphicsView::mouseMoveEvent(event);
which propagated the event to the parent, which in turn sent it out to all the scene items.