mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 12:03:04 +02:00
qt: Move recentRequestsView properties settings to constructor
This is move-only change.
This commit is contained in:
@@ -62,6 +62,17 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWid
|
|||||||
connect(copyAmountAction, &QAction::triggered, this, &ReceiveCoinsDialog::copyAmount);
|
connect(copyAmountAction, &QAction::triggered, this, &ReceiveCoinsDialog::copyAmount);
|
||||||
|
|
||||||
connect(ui->clearButton, &QPushButton::clicked, this, &ReceiveCoinsDialog::clear);
|
connect(ui->clearButton, &QPushButton::clicked, this, &ReceiveCoinsDialog::clear);
|
||||||
|
|
||||||
|
QTableView* tableView = ui->recentRequestsView;
|
||||||
|
tableView->verticalHeader()->hide();
|
||||||
|
tableView->setAlternatingRowColors(true);
|
||||||
|
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
|
||||||
|
tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH);
|
||||||
|
tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH);
|
||||||
|
tableView->setColumnWidth(RecentRequestsTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
|
||||||
|
tableView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
||||||
|
tableView->horizontalHeader()->setStretchLastSection(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
||||||
@@ -75,18 +86,7 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
|
|||||||
updateDisplayUnit();
|
updateDisplayUnit();
|
||||||
|
|
||||||
QTableView* tableView = ui->recentRequestsView;
|
QTableView* tableView = ui->recentRequestsView;
|
||||||
|
|
||||||
tableView->verticalHeader()->hide();
|
|
||||||
tableView->setModel(_model->getRecentRequestsTableModel());
|
tableView->setModel(_model->getRecentRequestsTableModel());
|
||||||
tableView->setAlternatingRowColors(true);
|
|
||||||
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
||||||
tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
|
|
||||||
tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH);
|
|
||||||
tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH);
|
|
||||||
tableView->setColumnWidth(RecentRequestsTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
|
|
||||||
tableView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
|
||||||
tableView->horizontalHeader()->setStretchLastSection(true);
|
|
||||||
|
|
||||||
connect(tableView->selectionModel(),
|
connect(tableView->selectionModel(),
|
||||||
&QItemSelectionModel::selectionChanged, this,
|
&QItemSelectionModel::selectionChanged, this,
|
||||||
&ReceiveCoinsDialog::recentRequestsView_selectionChanged);
|
&ReceiveCoinsDialog::recentRequestsView_selectionChanged);
|
||||||
|
Reference in New Issue
Block a user