Skip to content

Commit

Permalink
QWheelEvent::delta is no more
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 27, 2021
1 parent 27b99d6 commit 881205d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgscolorwidgets.cpp
Expand Up @@ -1169,7 +1169,7 @@ void QgsColorRampWidget::wheelEvent( QWheelEvent *event )
{
int oldValue = componentValue();

if ( event->delta() > 0 )
if ( event->angleDelta().y() > 0 )
{
setComponentValue( componentValue() + 1 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfontbutton.cpp
Expand Up @@ -389,7 +389,7 @@ void QgsFontButton::wheelEvent( QWheelEvent *event )
}

double increment = ( event->modifiers() & Qt::ControlModifier ) ? 0.1 : 1;
if ( event->delta() > 0 )
if ( event->angleDelta().y() > 0 )
{
size += increment;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -2088,7 +2088,7 @@ void QgsMapCanvas::wheelEvent( QWheelEvent *e )
// Zoom the map canvas in response to a mouse wheel event. Moving the
// wheel forward (away) from the user zooms in

QgsDebugMsgLevel( "Wheel event delta " + QString::number( e->delta() ), 2 );
QgsDebugMsgLevel( "Wheel event delta " + QString::number( e->angleDelta().y() ), 2 );

if ( mMapTool )
{
Expand All @@ -2097,7 +2097,7 @@ void QgsMapCanvas::wheelEvent( QWheelEvent *e )
return;
}

if ( e->delta() == 0 )
if ( e->angleDelta().y() == 0 )
{
e->accept();
return;
Expand Down

0 comments on commit 881205d

Please sign in to comment.