Don't use QWheelEvent deprecated functions

This commit is contained in:
Chocobo1 2020-06-04 13:29:32 +08:00
parent 4971cb9a27
commit 2fd4381398
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
2 changed files with 16 additions and 2 deletions

View file

@ -451,7 +451,14 @@ void PeerListWidget::wheelEvent(QWheelEvent *event)
// Shift + scroll = horizontal scroll
event->accept();
QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QWheelEvent scrollHEvent(event->position(), event->globalPosition()
, event->pixelDelta(), event->angleDelta().transposed(), event->buttons()
, event->modifiers(), event->phase(), event->inverted(), event->source());
#else
QWheelEvent scrollHEvent(event->pos(), event->globalPos()
, event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
#endif
QTreeView::wheelEvent(&scrollHEvent);
return;
}

View file

@ -1204,7 +1204,14 @@ void TransferListWidget::wheelEvent(QWheelEvent *event)
// Shift + scroll = horizontal scroll
event->accept();
QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QWheelEvent scrollHEvent(event->position(), event->globalPosition()
, event->pixelDelta(), event->angleDelta().transposed(), event->buttons()
, event->modifiers(), event->phase(), event->inverted(), event->source());
#else
QWheelEvent scrollHEvent(event->pos(), event->globalPos()
, event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
#endif
QTreeView::wheelEvent(&scrollHEvent);
return;
}