Allow horizontal scrolling with Shift+Scroll in EntryView.

This commit is contained in:
Patrick Sean Klein 2024-10-09 22:44:23 +01:00
parent 740994ed48
commit 8c031605e7
No known key found for this signature in database
GPG Key ID: B6D50F39A56F6906
2 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include <QMenu>
#include <QPainter>
#include <QScreen>
#include <QScrollBar>
#include <QShortcut>
#include <QStyledItemDelegate>
#include <QWindow>
@ -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);
}
}

View File

@ -62,6 +62,7 @@ protected:
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);