Skip to content

Commit

Permalink
Scroll area wheel event blocking should not propagate to item views
Browse files Browse the repository at this point in the history
This isn't required, and causes item views to get temporarily "stuck"
when mouse scrolling to top or bottom of view
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Jan 25, 2022
1 parent ec672f1 commit 7c7ce7a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/qgsscrollarea.cpp
Expand Up @@ -18,6 +18,7 @@
#include <QEvent>
#include <QMouseEvent>
#include <QScrollBar>
#include <QAbstractItemView>

// milliseconds to swallow child wheel events for after a scroll occurs
#define TIMEOUT 1000
Expand Down Expand Up @@ -144,7 +145,7 @@ void ScrollAreaFilter::addChild( QObject *child )
{
if ( child && child->isWidgetType() )
{
if ( qobject_cast< QScrollArea * >( child ) )
if ( qobject_cast< QScrollArea * >( child ) || qobject_cast< QAbstractItemView * >( child ) )
return;

child->installEventFilter( this );
Expand All @@ -164,7 +165,7 @@ void ScrollAreaFilter::removeChild( QObject *child )
{
if ( child && child->isWidgetType() )
{
if ( qobject_cast< QScrollArea * >( child ) )
if ( qobject_cast< QScrollArea * >( child ) || qobject_cast< QAbstractItemView * >( child ) )
return;

child->removeEventFilter( this );
Expand Down

0 comments on commit 7c7ce7a

Please sign in to comment.