|
|
@ -32,6 +32,9 @@ |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
#include <QFile> |
|
|
|
#include <QFile> |
|
|
|
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
|
|
|
|
|
|
#include <QTableView> |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include "core/utils/misc.h" |
|
|
|
#include "core/utils/misc.h" |
|
|
|
#include "previewlistdelegate.h" |
|
|
|
#include "previewlistdelegate.h" |
|
|
@ -51,6 +54,14 @@ PreviewSelect::PreviewSelect(QWidget* parent, BitTorrent::TorrentHandle *const t |
|
|
|
previewListModel->setHeaderData(NAME, Qt::Horizontal, tr("Name")); |
|
|
|
previewListModel->setHeaderData(NAME, Qt::Horizontal, tr("Name")); |
|
|
|
previewListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size")); |
|
|
|
previewListModel->setHeaderData(SIZE, Qt::Horizontal, tr("Size")); |
|
|
|
previewListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress")); |
|
|
|
previewListModel->setHeaderData(PROGRESS, Qt::Horizontal, tr("Progress")); |
|
|
|
|
|
|
|
#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(previewList->header()); |
|
|
|
|
|
|
|
previewList->header()->setParent(previewList); |
|
|
|
|
|
|
|
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); |
|
|
|
|
|
|
|
#endif |
|
|
|
previewList->setModel(previewListModel); |
|
|
|
previewList->setModel(previewListModel); |
|
|
|
previewList->hideColumn(FILE_INDEX); |
|
|
|
previewList->hideColumn(FILE_INDEX); |
|
|
|
listDelegate = new PreviewListDelegate(this); |
|
|
|
listDelegate = new PreviewListDelegate(this); |
|
|
|