diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -182,37 +182,56 @@ mapperThirdPartyTxUrls = new QSignalMapper(this); // Connect actions - connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, - SLOT(openThirdPartyTxUrl(QString))); - - connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int))); - connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int))); - connect(watchOnlyWidget, SIGNAL(activated(int)), this, - SLOT(chooseWatchonly(int))); - connect(amountWidget, SIGNAL(textChanged(QString)), amount_typing_delay, - SLOT(start())); - connect(amount_typing_delay, SIGNAL(timeout()), this, - SLOT(changedAmount())); - connect(search_widget, SIGNAL(textChanged(QString)), prefix_typing_delay, - SLOT(start())); - connect(prefix_typing_delay, SIGNAL(timeout()), this, - SLOT(changedSearch())); - - connect(view, SIGNAL(doubleClicked(QModelIndex)), this, - SIGNAL(doubleClicked(QModelIndex))); - connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(contextualMenu(QPoint))); - - connect(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx())); - connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); - connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); - connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); - connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); - connect(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex())); - connect(copyTxPlainText, SIGNAL(triggered()), this, - SLOT(copyTxPlainText())); - connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); - connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); + connect(mapperThirdPartyTxUrls, + static_cast( + &QSignalMapper::mapped), + this, &TransactionView::openThirdPartyTxUrl); + + connect(dateWidget, + static_cast(&QComboBox::activated), this, + &TransactionView::chooseDate); + connect(typeWidget, + static_cast(&QComboBox::activated), this, + &TransactionView::chooseType); + connect(watchOnlyWidget, + static_cast(&QComboBox::activated), this, + &TransactionView::chooseWatchonly); + connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, + static_cast(&QTimer::start)); + connect(amount_typing_delay, &QTimer::timeout, this, + &TransactionView::changedAmount); + connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, + static_cast(&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(abandonAction, &QAction::triggered, this, + &TransactionView::abandonTx); + connect(copyAddressAction, &QAction::triggered, this, + &TransactionView::copyAddress); + connect(copyLabelAction, &QAction::triggered, this, + &TransactionView::copyLabel); + connect(copyAmountAction, &QAction::triggered, this, + &TransactionView::copyAmount); + connect(copyTxIDAction, &QAction::triggered, this, + &TransactionView::copyTxID); + connect(copyTxHexAction, &QAction::triggered, this, + &TransactionView::copyTxHex); + connect(copyTxPlainText, &QAction::triggered, this, + &TransactionView::copyTxPlainText); + connect(editLabelAction, &QAction::triggered, this, + &TransactionView::editLabel); + connect(showDetailsAction, &QAction::triggered, this, + &TransactionView::showDetails); + // Double-clicking on a transaction on the transaction history page shows + // details + connect(this, &TransactionView::doubleClicked, this, + &TransactionView::showDetails); } void TransactionView::setModel(WalletModel *_model) { @@ -267,8 +286,10 @@ contextMenu->addSeparator(); } contextMenu->addAction(thirdPartyTxUrlAction); - connect(thirdPartyTxUrlAction, SIGNAL(triggered()), - mapperThirdPartyTxUrls, SLOT(map())); + connect(thirdPartyTxUrlAction, &QAction::triggered, + mapperThirdPartyTxUrls, + static_cast( + &QSignalMapper::map)); mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction, listUrls[i].trimmed()); } @@ -279,8 +300,8 @@ updateWatchOnlyColumn(_model->wallet().haveWatchOnly()); // Watch-only signal - connect(_model, SIGNAL(notifyWatchonlyChanged(bool)), this, - SLOT(updateWatchOnlyColumn(bool))); + connect(_model, &WalletModel::notifyWatchonlyChanged, this, + &TransactionView::updateWatchOnlyColumn); } } @@ -595,9 +616,10 @@ dateRangeWidget->setVisible(false); // Notify on change - connect(dateFrom, SIGNAL(dateChanged(QDate)), this, - SLOT(dateRangeChanged())); - connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); + connect(dateFrom, &QDateTimeEdit::dateChanged, this, + &TransactionView::dateRangeChanged); + connect(dateTo, &QDateTimeEdit::dateChanged, this, + &TransactionView::dateRangeChanged); return dateRangeWidget; }