Commit f2b8777b authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

gui/qt: fix invalid static_cast

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
undefined-behavior.
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 2feb0e80
......@@ -475,17 +475,24 @@ bool SeekSlider::eventFilter( QObject *obj, QEvent *event )
{
if( obj == mTimeTooltip )
{
if( event->type() == QEvent::MouseMove )
{
QMouseEvent* mev = static_cast<QMouseEvent*>( event );
if( rect().contains( mapFromGlobal( mev->globalPos() ) ) )
return false;
}
if( event->type() == QEvent::Leave ||
event->type() == QEvent::MouseMove )
{
QMouseEvent *e = static_cast<QMouseEvent*>( event );
if( !rect().contains( mapFromGlobal( e->globalPos() ) ) )
mTimeTooltip->hide();
mTimeTooltip->hide();
}
return false;
}
else
return QSlider::eventFilter( obj, event );
return QSlider::eventFilter( obj, event );
}
QSize SeekSlider::sizeHint() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment