From 864b59fcf1915bd2ca13703cc1e625f435224b27 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Thu, 28 May 2020 18:53:31 +0200 Subject: [PATCH] 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. --- src/kitemviews/kitemlistcontainer.cpp | 4 ++-- 1 file 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; -- 2.47.3