Commit 64967211 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Port away from deprecated QWheelEvent::delta()

QWheelEvent::angleDelta() returns a QPoint instead of int, so we need to
use its y() value to get the number of steps.
parent 327c22bc
......@@ -847,10 +847,10 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
void DolphinView::wheelEvent(QWheelEvent* event)
{
if (event->modifiers().testFlag(Qt::ControlModifier)) {
const int numDegrees = event->delta() / 8;
const int numSteps = numDegrees / 15;
const QPoint numDegrees = event->angleDelta() / 8;
const QPoint numSteps = numDegrees / 15;
setZoomLevel(zoomLevel() + numSteps);
setZoomLevel(zoomLevel() + numSteps.y());
event->accept();
} else {
event->ignore();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment