mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Shift + scroll = horizontal scroll, Closes #5980
Only for TransferListWidget, PeerListWidget
This commit is contained in:
parent
d73688bfd8
commit
f4652b3f7b
4 changed files with 33 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QWheelEvent>
|
||||||
#ifdef QBT_USES_QT5
|
#ifdef QBT_USES_QT5
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
#endif
|
#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);
|
void handleResolved(const QString &ip, const QString &hostname);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
|
|
||||||
QStandardItemModel *m_listModel;
|
QStandardItemModel *m_listModel;
|
||||||
PeerListDelegate *m_listDelegate;
|
PeerListDelegate *m_listDelegate;
|
||||||
PeerListSortModel *m_proxyModel;
|
PeerListSortModel *m_proxyModel;
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QWheelEvent>
|
||||||
#ifdef QBT_USES_QT5
|
#ifdef QBT_USES_QT5
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
#endif
|
#endif
|
||||||
|
@ -933,6 +934,20 @@ bool TransferListWidget::loadSettings()
|
||||||
return ok;
|
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 extractHashes(const QList<BitTorrent::TorrentHandle *> &torrents)
|
||||||
{
|
{
|
||||||
QStringList hashes;
|
QStringList hashes;
|
||||||
|
|
|
@ -115,6 +115,8 @@ signals:
|
||||||
void currentTorrentChanged(BitTorrent::TorrentHandle *const torrent);
|
void currentTorrentChanged(BitTorrent::TorrentHandle *const torrent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
|
|
||||||
TransferListDelegate *listDelegate;
|
TransferListDelegate *listDelegate;
|
||||||
TorrentModel *listModel;
|
TorrentModel *listModel;
|
||||||
TransferListSortModel *nameFilterModel;
|
TransferListSortModel *nameFilterModel;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue