Don't use hack to make the first column movable

PR #16545.
This commit is contained in:
thalieht
2022-03-01 06:50:10 +02:00
committed by GitHub
parent 98bdfcef65
commit 63812ca951
7 changed files with 7 additions and 58 deletions

View File

@@ -34,7 +34,6 @@
#include <QLineEdit>
#include <QMessageBox>
#include <QModelIndexList>
#include <QTableView>
#include <QThread>
#include "base/bittorrent/abstractfilestorage.h"
@@ -66,15 +65,7 @@ TorrentContentTreeView::TorrentContentTreeView(QWidget *parent)
: QTreeView(parent)
{
setExpandsOnDoubleClick(false);
// This hack fixes reordering of first column with Qt5.
// https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
QTableView unused;
unused.setVerticalHeader(header());
header()->setParent(this);
header()->setStretchLastSection(false);
header()->setTextElideMode(Qt::ElideRight);
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
header()->setFirstSectionMovable(true);
}
void TorrentContentTreeView::keyPressEvent(QKeyEvent *event)