Allow resizing of reports table columns (#6435)

* Fix #5678

Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
Xavier Valls 2021-04-24 17:36:15 +02:00 committed by GitHub
parent 7b7f52c8af
commit 01d86760e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -148,8 +148,10 @@ ReportsWidgetHealthcheck::ReportsWidgetHealthcheck(QWidget* parent)
m_modelProxy->setSortLocaleAware(true);
m_ui->healthcheckTableView->setModel(m_modelProxy.data());
m_ui->healthcheckTableView->setSelectionMode(QAbstractItemView::NoSelection);
m_ui->healthcheckTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
m_ui->healthcheckTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
m_ui->healthcheckTableView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
m_ui->healthcheckTableView->setSortingEnabled(true);
m_ui->healthcheckTableView->setWordWrap(true);
connect(m_ui->healthcheckTableView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint)));
connect(m_ui->healthcheckTableView, SIGNAL(doubleClicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
@ -279,7 +281,8 @@ void ReportsWidgetHealthcheck::calculateHealth()
m_ui->healthcheckTableView->sortByColumn(0, Qt::AscendingOrder);
}
m_ui->healthcheckTableView->resizeRowsToContents();
m_ui->healthcheckTableView->resizeColumnsToContents();
m_ui->healthcheckTableView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
// Show the "show known bad entries" checkbox if there's any known
// bad entry in the database.

View File

@ -65,7 +65,8 @@ ReportsWidgetHibp::ReportsWidgetHibp(QWidget* parent)
m_modelProxy->setSortLocaleAware(true);
m_ui->hibpTableView->setModel(m_modelProxy.data());
m_ui->hibpTableView->setSelectionMode(QAbstractItemView::NoSelection);
m_ui->hibpTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
m_ui->hibpTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
m_ui->hibpTableView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
m_ui->hibpTableView->setSortingEnabled(true);
connect(m_ui->hibpTableView, SIGNAL(doubleClicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
@ -203,7 +204,7 @@ void ReportsWidgetHibp::makeHibpTable()
m_ui->showKnownBadCheckBox->hide();
}
m_ui->hibpTableView->resizeRowsToContents();
m_ui->hibpTableView->resizeColumnsToContents();
m_ui->hibpTableView->sortByColumn(2, Qt::DescendingOrder);
m_ui->stackedWidget->setCurrentIndex(1);