┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2020-05-28 18:53:31 +0200
committerElvis Angelaccio <[email protected]>2020-08-17 20:19:44 +0000
commit864b59fcf1915bd2ca13703cc1e625f435224b27 (patch)
treed664cb083830d5001bfdb62b699b8a69eb6942ec /src
parent97a14db70d9d16e595d1bced0d77ccdbba298bd9 (diff)
Port away from QWheelEvent::orientation()
We are supposed to use QWheelEvent::angleDelta() instead. Upon an horizontal/vertical scroll event, its `x()`/`y()` method will return a value different from zero.
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kitemlistcontainer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp
index 6279b15a9..e482f6eac 100644
--- a/src/kitemviews/kitemlistcontainer.cpp
+++ b/src/kitemviews/kitemlistcontainer.cpp
@@ -176,8 +176,8 @@ void KItemListContainer::wheelEvent(QWheelEvent* event)
return;
}
- const bool scrollHorizontally = (event->orientation() == Qt::Horizontal) ||
- (event->orientation() == Qt::Vertical && !verticalScrollBar()->isVisible());
+ const bool scrollHorizontally = (event->angleDelta().x() != 0) ||
+ (event->angleDelta().y() != 0 && !verticalScrollBar()->isVisible());
KItemListSmoothScroller* smoothScroller = scrollHorizontally ?
m_horizontalSmoothScroller : m_verticalSmoothScroller;