[Qt-interest] QGraphicsWidget hover events

Colin Kern colin.kern at gmail.com
Fri Jun 12 11:07:35 CEST 2009


Hi,

I'm trying to implement the hoverEnterEvent for a QGraphicsWidget, and
I can't get it to work.  I call setAcceptHoverEvents(true) in the
constructor, but the hoverEnterEvent still is never called.  Looking
at event() in qgraphicswidget.cpp, it looks to me like if window
decorations aren't set, then the hover events are just ignored.  Also,
the hoverLeaveEvent and hoverMoveEvent are reimplemented in
qgraphicswidget.cpp, but not hoverEnterEvent.  I have tried
implementing hoverLeaveEvent and hoverMoveEvent to see if those events
are ever triggered, and they don't seem to be either.  How can I get
hover events working in a QGraphicsWidget?

Thanks,
Colin



More information about the Qt-interest-old mailing list