diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-01-31 17:20:19 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-01-31 18:09:30 +0200 |
commit | ecdbaf71c0e1a4363e7eb019dabeb0018522ef70 (patch) | |
tree | 67049d9f32dd28d0d6999b9e04ee428d86a96fee | |
parent | 3913d1e8c1f604bdd622d5e81e5077ef52b30466 (diff) | |
download | bitcoin-ecdbaf71c0e1a4363e7eb019dabeb0018522ef70.tar.xz |
qt, refactor: Drop intermediate assignment
This change improves code readability.
-rw-r--r-- | src/qt/transactionview.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 22cbb7fb69..fdb96d0d73 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -126,27 +126,23 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa vlayout->setContentsMargins(0,0,0,0); vlayout->setSpacing(0); - QTableView *view = new QTableView(this); + transactionView = new QTableView(this); + transactionView->setObjectName("transactionView"); vlayout->addLayout(hlayout); vlayout->addWidget(createDateRangeWidget()); - vlayout->addWidget(view); + vlayout->addWidget(transactionView); vlayout->setSpacing(0); - int width = view->verticalScrollBar()->sizeHint().width(); + int width = transactionView->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing if (platformStyle->getUseExtraSpacing()) { hlayout->addSpacing(width+2); } else { hlayout->addSpacing(width); } - // Always show scroll bar - view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - view->setTabKeyNavigation(false); - view->setContextMenuPolicy(Qt::CustomContextMenu); - - view->installEventFilter(this); - - transactionView = view; - transactionView->setObjectName("transactionView"); + transactionView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + transactionView->setTabKeyNavigation(false); + transactionView->setContextMenuPolicy(Qt::CustomContextMenu); + transactionView->installEventFilter(this); // Actions abandonAction = new QAction(tr("Abandon transaction"), this); @@ -183,8 +179,8 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start)); connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch); - connect(view, &QTableView::doubleClicked, this, &TransactionView::doubleClicked); - connect(view, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu); + connect(transactionView, &QTableView::doubleClicked, this, &TransactionView::doubleClicked); + connect(transactionView, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu); connect(bumpFeeAction, &QAction::triggered, this, &TransactionView::bumpFee); connect(abandonAction, &QAction::triggered, this, &TransactionView::abandonTx); |