|
|
|
@ -37,7 +37,6 @@
@@ -37,7 +37,6 @@
|
|
|
|
|
#include <QPushButton> |
|
|
|
|
#include <QShowEvent> |
|
|
|
|
#include <QStandardItemModel> |
|
|
|
|
#include <QTableView> |
|
|
|
|
|
|
|
|
|
#include "base/bittorrent/torrent.h" |
|
|
|
|
#include "base/preferences.h" |
|
|
|
@ -77,13 +76,6 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::Torr
@@ -77,13 +76,6 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::Torr
|
|
|
|
|
m_previewListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size")); |
|
|
|
|
m_previewListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress")); |
|
|
|
|
|
|
|
|
|
// This hack fixes reordering of first column with Qt5.
|
|
|
|
|
// https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
|
|
|
|
|
QTableView unused; |
|
|
|
|
unused.setVerticalHeader(m_ui->previewList->header()); |
|
|
|
|
m_ui->previewList->header()->setParent(m_ui->previewList); |
|
|
|
|
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); |
|
|
|
|
|
|
|
|
|
m_ui->previewList->setAlternatingRowColors(pref->useAlternatingRowColors()); |
|
|
|
|
m_ui->previewList->setModel(m_previewListModel); |
|
|
|
|
m_ui->previewList->hideColumn(FILE_INDEX); |
|
|
|
@ -107,6 +99,7 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::Torr
@@ -107,6 +99,7 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::Torr
|
|
|
|
|
|
|
|
|
|
m_previewListModel->sort(NAME); |
|
|
|
|
m_ui->previewList->header()->setContextMenuPolicy(Qt::CustomContextMenu); |
|
|
|
|
m_ui->previewList->header()->setFirstSectionMovable(true); |
|
|
|
|
m_ui->previewList->header()->setSortIndicator(0, Qt::AscendingOrder); |
|
|
|
|
m_ui->previewList->selectionModel()->select(m_previewListModel->index(0, NAME), QItemSelectionModel::Select | QItemSelectionModel::Rows); |
|
|
|
|
|
|
|
|
|