mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Fix reordering of first column with Qt5. Closes #2835.
This commit is contained in:
@@ -32,12 +32,25 @@
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QModelIndexList>
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
#include <QTableView>
|
||||
#include <QHeaderView>
|
||||
#endif
|
||||
|
||||
#include "torrentcontentmodelitem.h"
|
||||
|
||||
TorrentContentTreeView::TorrentContentTreeView(QWidget* parent)
|
||||
: QTreeView(parent)
|
||||
{}
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
// This hack fixes reordering of first column with Qt5.
|
||||
// https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
|
||||
QTableView unused;
|
||||
unused.setVerticalHeader(header());
|
||||
header()->setParent(this);
|
||||
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
|
||||
#endif
|
||||
}
|
||||
|
||||
void TorrentContentTreeView::keyPressEvent(QKeyEvent *event) {
|
||||
if (event->key() != Qt::Key_Space && event->key() != Qt::Key_Select) {
|
||||
|
||||
Reference in New Issue
Block a user