mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
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.
This commit is contained in:
parent
327c22bc3b
commit
6496721110
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue