diff --git a/src/gui/properties/trackerlistwidget.cpp b/src/gui/properties/trackerlistwidget.cpp index a56b456b0..0c9b1c226 100644 --- a/src/gui/properties/trackerlistwidget.cpp +++ b/src/gui/properties/trackerlistwidget.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include "base/bittorrent/peerinfo.h" #include "base/bittorrent/session.h" @@ -683,3 +684,19 @@ void TrackerListWidget::displayColumnHeaderMenu() menu->popup(QCursor::pos()); } + +void TrackerListWidget::wheelEvent(QWheelEvent *event) +{ + if (event->modifiers() & Qt::ShiftModifier) + { + // Shift + scroll = horizontal scroll + event->accept(); + QWheelEvent scrollHEvent {event->position(), event->globalPosition() + , event->pixelDelta(), event->angleDelta().transposed(), event->buttons() + , event->modifiers(), event->phase(), event->inverted(), event->source()}; + QTreeView::wheelEvent(&scrollHEvent); + return; + } + + QTreeView::wheelEvent(event); // event delegated to base class +} diff --git a/src/gui/properties/trackerlistwidget.h b/src/gui/properties/trackerlistwidget.h index 618607214..99f56d6e8 100644 --- a/src/gui/properties/trackerlistwidget.h +++ b/src/gui/properties/trackerlistwidget.h @@ -87,6 +87,7 @@ private slots: private: int visibleColumnsCount() const; + void wheelEvent(QWheelEvent *event) override; static QStringList headerLabels(); diff --git a/src/gui/torrentcontenttreeview.cpp b/src/gui/torrentcontenttreeview.cpp index 20437d044..984baca52 100644 --- a/src/gui/torrentcontenttreeview.cpp +++ b/src/gui/torrentcontenttreeview.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "base/bittorrent/abstractfilestorage.h" #include "base/bittorrent/common.h" @@ -152,3 +153,19 @@ QModelIndex TorrentContentTreeView::currentNameCell() return model()->index(current.row(), TorrentContentModelItem::COL_NAME, current.parent()); } + +void TorrentContentTreeView::wheelEvent(QWheelEvent *event) +{ + if (event->modifiers() & Qt::ShiftModifier) + { + // Shift + scroll = horizontal scroll + event->accept(); + QWheelEvent scrollHEvent {event->position(), event->globalPosition() + , event->pixelDelta(), event->angleDelta().transposed(), event->buttons() + , event->modifiers(), event->phase(), event->inverted(), event->source()}; + QTreeView::wheelEvent(&scrollHEvent); + return; + } + + QTreeView::wheelEvent(event); // event delegated to base class +} diff --git a/src/gui/torrentcontenttreeview.h b/src/gui/torrentcontenttreeview.h index a6ee2563b..1e8a5cfa7 100644 --- a/src/gui/torrentcontenttreeview.h +++ b/src/gui/torrentcontenttreeview.h @@ -50,4 +50,5 @@ public: private: QModelIndex currentNameCell(); + void wheelEvent(QWheelEvent *event) override; };