mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
qt: Fix regression with initial sorting after pr205
QTableView widget must be explicitly sorted after the setModel call.
This commit is contained in:
parent
fb67caebe2
commit
c524dc54bb
2 changed files with 3 additions and 2 deletions
|
@ -81,7 +81,6 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
|
||||||
tableView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
tableView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
||||||
tableView->horizontalHeader()->setStretchLastSection(true);
|
tableView->horizontalHeader()->setStretchLastSection(true);
|
||||||
}
|
}
|
||||||
tableView->horizontalHeader()->setSortIndicator(RecentRequestsTableModel::Date, Qt::DescendingOrder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
||||||
|
@ -96,6 +95,8 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
||||||
|
|
||||||
QTableView* tableView = ui->recentRequestsView;
|
QTableView* tableView = ui->recentRequestsView;
|
||||||
tableView->setModel(_model->getRecentRequestsTableModel());
|
tableView->setModel(_model->getRecentRequestsTableModel());
|
||||||
|
tableView->sortByColumn(RecentRequestsTableModel::Date, Qt::DescendingOrder);
|
||||||
|
|
||||||
connect(tableView->selectionModel(),
|
connect(tableView->selectionModel(),
|
||||||
&QItemSelectionModel::selectionChanged, this,
|
&QItemSelectionModel::selectionChanged, this,
|
||||||
&ReceiveCoinsDialog::recentRequestsView_selectionChanged);
|
&ReceiveCoinsDialog::recentRequestsView_selectionChanged);
|
||||||
|
|
|
@ -160,7 +160,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
|
||||||
transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
||||||
transactionView->horizontalHeader()->setStretchLastSection(true);
|
transactionView->horizontalHeader()->setStretchLastSection(true);
|
||||||
}
|
}
|
||||||
transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder);
|
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
abandonAction = new QAction(tr("Abandon transaction"), this);
|
abandonAction = new QAction(tr("Abandon transaction"), this);
|
||||||
|
@ -236,6 +235,7 @@ void TransactionView::setModel(WalletModel *_model)
|
||||||
transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||||
transactionProxyModel->setSortRole(Qt::EditRole);
|
transactionProxyModel->setSortRole(Qt::EditRole);
|
||||||
transactionView->setModel(transactionProxyModel);
|
transactionView->setModel(transactionProxyModel);
|
||||||
|
transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
|
||||||
|
|
||||||
if (_model->getOptionsModel())
|
if (_model->getOptionsModel())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue