Skip to content

Commit

Permalink
Don't recursively try to handle scroll event logic in nested scroll
Browse files Browse the repository at this point in the history
areas

Fixes #46871

(cherry picked from commit f589e6e)
  • Loading branch information
nyalldawson committed Jan 25, 2022
1 parent 7580b8b commit b22edd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsscrollarea.cpp
Expand Up @@ -144,6 +144,9 @@ void ScrollAreaFilter::addChild( QObject *child )
{
if ( child && child->isWidgetType() )
{
if ( qobject_cast< QScrollArea * >( child ) )
return;

child->installEventFilter( this );
if ( QWidget *w = qobject_cast< QWidget * >( child ) )
w->setMouseTracking( true );
Expand All @@ -161,6 +164,9 @@ void ScrollAreaFilter::removeChild( QObject *child )
{
if ( child && child->isWidgetType() )
{
if ( qobject_cast< QScrollArea * >( child ) )
return;

child->removeEventFilter( this );

// also remove filter on existing children
Expand Down

0 comments on commit b22edd3

Please sign in to comment.