Search code examples
qtqt5qwidgetqeventqmouseevent

Determine mouse event: hover leave parent for child widget


I have 2 widgets, a parent and a child widget:

enter image description here

Having access to the implementation of the red widget, is it possible to determine the moment when the cursor hovers out of the red widget into the blue widget without implementing any event handlers or deriving the blue widget?

The red area has a well defined thickness(e.g. 5px).


Solution

  • IMHO you cannot catch the transition without catching one mouse move event from the red widget and one mouse move event from the blue widget, since the mouse can jump on screen and may not move in a continuous fashion.