mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 22:33:34 -07:00
Use QTreeView in MacOSShiftClickHandler
This commit is contained in:
parent
7d2360fd5e
commit
734910c281
2 changed files with 6 additions and 7 deletions
|
@ -29,11 +29,10 @@
|
||||||
#include "macosshiftclickhandler.h"
|
#include "macosshiftclickhandler.h"
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include "transferlistwidget.h"
|
#include <QTreeView>
|
||||||
|
|
||||||
MacOSShiftClickHandler::MacOSShiftClickHandler(TransferListWidget *treeView)
|
MacOSShiftClickHandler::MacOSShiftClickHandler(QTreeView *treeView)
|
||||||
: QObject(treeView)
|
: QObject(treeView), m_treeView{treeView}
|
||||||
, m_treeView {treeView}
|
|
||||||
{
|
{
|
||||||
treeView->installEventFilter(this);
|
treeView->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPersistentModelIndex>
|
#include <QPersistentModelIndex>
|
||||||
|
|
||||||
class TransferListWidget;
|
class QTreeView;
|
||||||
|
|
||||||
// Workaround for QTBUG-115838: Shift-click range selection not working properly on macOS
|
// Workaround for QTBUG-115838: Shift-click range selection not working properly on macOS
|
||||||
class MacOSShiftClickHandler final : public QObject
|
class MacOSShiftClickHandler final : public QObject
|
||||||
|
@ -40,11 +40,11 @@ class MacOSShiftClickHandler final : public QObject
|
||||||
Q_DISABLE_COPY_MOVE(MacOSShiftClickHandler)
|
Q_DISABLE_COPY_MOVE(MacOSShiftClickHandler)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MacOSShiftClickHandler(TransferListWidget *treeView);
|
explicit MacOSShiftClickHandler(QTreeView *treeView);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||||
|
|
||||||
TransferListWidget *m_treeView = nullptr;
|
QTreeView *m_treeView = nullptr;
|
||||||
QPersistentModelIndex m_lastClickedIndex;
|
QPersistentModelIndex m_lastClickedIndex;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue