cleanup: replace long obsolete delta() member

This has been deprecated for years.
The delta() member dealt with the old style mouse wheel that is associated with
a vertical scroll - so we need the y-component.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-10-26 07:50:13 -07:00
parent bbf76f9ee7
commit 0c2bfc1103

View file

@ -1014,10 +1014,10 @@ void ProfileWidget2::wheelEvent(QWheelEvent *event)
QPoint toolTipPos = mapFromScene(toolTipItem->pos());
if (event->buttons() == Qt::LeftButton)
return;
if (event->delta() > 0 && zoomLevel < 20) {
if (event->angleDelta().y() > 0 && zoomLevel < 20) {
scale(zoomFactor, zoomFactor);
zoomLevel++;
} else if (event->delta() < 0 && zoomLevel > 0) {
} else if (event->angleDelta().y() < 0 && zoomLevel > 0) {
// Zooming out
scale(1.0 / zoomFactor, 1.0 / zoomFactor);
zoomLevel--;