0
votes

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).

2
what you want to do with this information? If you want only change appearance of widget then setStyleSheet should do the job.Marek R
i don't want just appearance. i would need the cursor to change in when the mouse enters and leaves the area. the problem is that when the cursor leaves the area i want to reset it to its previous formJacob Krieg
so just set cursor property on both widgets.Marek R
I understand but I need a different cursor for each edge. the function is very handy but it will provide me only one cursor type. I would like the red area to be a border with which you can resize the windowJacob Krieg
for such functionality I would add a separate widget for each edge and merge it only visually.Marek R

2 Answers

1
votes

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.

1
votes

Without deriving: use event filter, QEvent type is HoverEnter and HoverLeave.

With Stylesheet

QWidget:hover{}