Cruz
29th December 2011, 21:48
Hello!
The title says it all, I want to detect if the mouse pointer is inside a widget or not. Mouse tracking is enabled and I get mouseMoveEvents when the mouse is moving inside the widget. However, I do not get an event when the mouse is outside of the widget, so I can't detect if the mouse is actually outside or just not moving.
I tried a naive approach by defining a margin along the border of the widget and if the mouse pointer is in that margin I assume that the mouse has left the widget. But any margin can be jumped over if the mouse is moving fast enough so this was a waste of time.
How to do it right?
The title says it all, I want to detect if the mouse pointer is inside a widget or not. Mouse tracking is enabled and I get mouseMoveEvents when the mouse is moving inside the widget. However, I do not get an event when the mouse is outside of the widget, so I can't detect if the mouse is actually outside or just not moving.
I tried a naive approach by defining a margin along the border of the widget and if the mouse pointer is in that margin I assume that the mouse has left the widget. But any margin can be jumped over if the mouse is moving fast enough so this was a waste of time.
How to do it right?