From e83019bdfab7e734789ee48b644be2e186f93e79 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 11 Jun 2019 20:32:34 +0800 Subject: [PATCH] Set wheel event to accepted only if we handle it --- src/gui/properties/peerlistwidget.cpp | 4 ++-- src/gui/transferlistwidget.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/properties/peerlistwidget.cpp b/src/gui/properties/peerlistwidget.cpp index 5682b840c..883a18a09 100644 --- a/src/gui/properties/peerlistwidget.cpp +++ b/src/gui/properties/peerlistwidget.cpp @@ -455,10 +455,10 @@ void PeerListWidget::handleSortColumnChanged(int col) void PeerListWidget::wheelEvent(QWheelEvent *event) { - event->accept(); - if (event->modifiers() & Qt::ShiftModifier) { // Shift + scroll = horizontal scroll + event->accept(); + QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal); QTreeView::wheelEvent(&scrollHEvent); return; diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index aa121ca2b..e548780b5 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -1226,10 +1226,10 @@ bool TransferListWidget::loadSettings() void TransferListWidget::wheelEvent(QWheelEvent *event) { - event->accept(); - if (event->modifiers() & Qt::ShiftModifier) { // Shift + scroll = horizontal scroll + event->accept(); + QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal); QTreeView::wheelEvent(&scrollHEvent); return;