mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Shift + scroll = horizontal scroll, Closes #5980
Only for TransferListWidget, PeerListWidget
This commit is contained in:
parent
d73688bfd8
commit
f4652b3f7b
@ -35,6 +35,7 @@
|
||||
#include <QMenu>
|
||||
#include <QClipboard>
|
||||
#include <QMessageBox>
|
||||
#include <QWheelEvent>
|
||||
#ifdef QBT_USES_QT5
|
||||
#include <QTableView>
|
||||
#endif
|
||||
@ -455,3 +456,16 @@ void PeerListWidget::handleSortColumnChanged(int col)
|
||||
}
|
||||
}
|
||||
|
||||
void PeerListWidget::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
event->accept();
|
||||
|
||||
if(event->modifiers() & Qt::ShiftModifier) {
|
||||
// Shift + scroll = horizontal scroll
|
||||
QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
|
||||
QTreeView::wheelEvent(&scrollHEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
QTreeView::wheelEvent(event); // event delegated to base class
|
||||
}
|
||||
|
@ -85,6 +85,8 @@ private slots:
|
||||
void handleResolved(const QString &ip, const QString &hostname);
|
||||
|
||||
private:
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
|
||||
QStandardItemModel *m_listModel;
|
||||
PeerListDelegate *m_listDelegate;
|
||||
PeerListSortModel *m_proxyModel;
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <QRegExp>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QWheelEvent>
|
||||
#ifdef QBT_USES_QT5
|
||||
#include <QTableView>
|
||||
#endif
|
||||
@ -933,6 +934,20 @@ bool TransferListWidget::loadSettings()
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TransferListWidget::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
event->accept();
|
||||
|
||||
if(event->modifiers() & Qt::ShiftModifier) {
|
||||
// Shift + scroll = horizontal scroll
|
||||
QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal);
|
||||
QTreeView::wheelEvent(&scrollHEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
QTreeView::wheelEvent(event); // event delegated to base class
|
||||
}
|
||||
|
||||
QStringList extractHashes(const QList<BitTorrent::TorrentHandle *> &torrents)
|
||||
{
|
||||
QStringList hashes;
|
||||
|
@ -115,6 +115,8 @@ signals:
|
||||
void currentTorrentChanged(BitTorrent::TorrentHandle *const torrent);
|
||||
|
||||
private:
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
|
||||
TransferListDelegate *listDelegate;
|
||||
TorrentModel *listModel;
|
||||
TransferListSortModel *nameFilterModel;
|
||||
|
Loading…
Reference in New Issue
Block a user