From 8c031605e75c83bbe3141f84e7509a3b5eb688d3 Mon Sep 17 00:00:00 2001 From: Patrick Sean Klein Date: Wed, 9 Oct 2024 22:44:23 +0100 Subject: [PATCH] Allow horizontal scrolling with Shift+Scroll in EntryView. --- src/gui/entry/EntryView.cpp | 10 ++++++++++ src/gui/entry/EntryView.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/gui/entry/EntryView.cpp b/src/gui/entry/EntryView.cpp index 1d7aa02b64..c089bf486d 100644 --- a/src/gui/entry/EntryView.cpp +++ b/src/gui/entry/EntryView.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -594,3 +595,12 @@ bool EntryView::isColumnHidden(int logicalIndex) { return header()->isSectionHidden(logicalIndex) || header()->sectionSize(logicalIndex) == 0; } + +void EntryView::wheelEvent(QWheelEvent* event) +{ + if (event->modifiers() & Qt::ShiftModifier) { + horizontalScrollBar()->event(event); + } else { + QAbstractScrollArea::wheelEvent(event); + } +} diff --git a/src/gui/entry/EntryView.h b/src/gui/entry/EntryView.h index 759097b346..c696c06aad 100644 --- a/src/gui/entry/EntryView.h +++ b/src/gui/entry/EntryView.h @@ -62,6 +62,7 @@ class EntryView : public QTreeView void focusInEvent(QFocusEvent* event) override; void showEvent(QShowEvent* event) override; void startDrag(Qt::DropActions supportedActions) override; + void wheelEvent(QWheelEvent* event) override; private slots: void emitEntryActivated(const QModelIndex& index);