mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-30 08:24:22 +00:00
commit
3c1774360f
@ -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…
x
Reference in New Issue
Block a user