mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
qt: Move transactionView properties settings to constructor
This is move-only change.
This commit is contained in:
parent
ecdbaf71c0
commit
788205c3f7
1 changed files with 14 additions and 16 deletions
|
@ -143,6 +143,20 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
|
||||||
transactionView->setTabKeyNavigation(false);
|
transactionView->setTabKeyNavigation(false);
|
||||||
transactionView->setContextMenuPolicy(Qt::CustomContextMenu);
|
transactionView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
transactionView->installEventFilter(this);
|
transactionView->installEventFilter(this);
|
||||||
|
transactionView->setAlternatingRowColors(true);
|
||||||
|
transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
|
transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder);
|
||||||
|
transactionView->setSortingEnabled(true);
|
||||||
|
transactionView->verticalHeader()->hide();
|
||||||
|
|
||||||
|
transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
|
||||||
|
transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
|
||||||
|
transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
|
||||||
|
transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
|
||||||
|
transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
|
||||||
|
transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
||||||
|
transactionView->horizontalHeader()->setStretchLastSection(true);
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
abandonAction = new QAction(tr("Abandon transaction"), this);
|
abandonAction = new QAction(tr("Abandon transaction"), this);
|
||||||
|
@ -210,24 +224,8 @@ void TransactionView::setModel(WalletModel *_model)
|
||||||
transactionProxyModel->setDynamicSortFilter(true);
|
transactionProxyModel->setDynamicSortFilter(true);
|
||||||
transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||||
transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
|
||||||
transactionProxyModel->setSortRole(Qt::EditRole);
|
transactionProxyModel->setSortRole(Qt::EditRole);
|
||||||
|
|
||||||
transactionView->setModel(transactionProxyModel);
|
transactionView->setModel(transactionProxyModel);
|
||||||
transactionView->setAlternatingRowColors(true);
|
|
||||||
transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
||||||
transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
|
||||||
transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder);
|
|
||||||
transactionView->setSortingEnabled(true);
|
|
||||||
transactionView->verticalHeader()->hide();
|
|
||||||
|
|
||||||
transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
|
|
||||||
transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
|
|
||||||
transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
|
|
||||||
transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
|
|
||||||
transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
|
|
||||||
transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
|
|
||||||
transactionView->horizontalHeader()->setStretchLastSection(true);
|
|
||||||
|
|
||||||
if (_model->getOptionsModel())
|
if (_model->getOptionsModel())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue