[Qt-interest] Why QGraphicsWidget reimplements hoverLeaveEvent with empty function?

Mihail Naydenov mlists at ymail.com
Wed May 6 19:46:01 CEST 2009


Hi,

QGraphicsItem implements both hoverEnter and hoverLeave to trigger repaint (is acceptHoverEvents), which is vary handy,
because one can easily implement "widget active" effect when the mouse is over the item.
But I was kind of surprised when a QGraphicsWidget-derivated item did trigger the proper repaint on Enter, but no repaint on Leave.
Turned out that QGraphicsWidget reimplements Leave with empty function, suppressing the default update. 

Is there a reason for that?
And if there is a reason, it should probably be documented.

Thank You
MihailNaydneov

PS Also, QGraphicsWidget reimplements hoverMoveEvent with empty func, which is exactly the same as the base impl. in QGraphicsItem.



      




More information about the Qt-interest-old mailing list