The dynamic type of the object referred to by "event" is not
QMouseEvent if "event->type()" is Event::Leave.
The previous implementation would unconditionally refer to the object
as-if it was a QMouseEvent when it is simply a QEvent; causing
Signed-off-by: Thomas Guillem <firstname.lastname@example.org>