diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -355,8 +355,8 @@ window = new BitcoinGUI(m_node, config, platformStyle, networkStyle, 0); pollShutdownTimer = new QTimer(window); - connect(pollShutdownTimer, SIGNAL(timeout()), window, - SLOT(detectShutdown())); + connect(pollShutdownTimer, &QTimer::timeout, window, + &BitcoinGUI::detectShutdown); } void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) { @@ -365,9 +365,10 @@ // the splash screen will take care of deleting itself when slotFinish // happens. splash->show(); - connect(this, SIGNAL(splashFinished(QWidget *)), splash, - SLOT(slotFinish(QWidget *))); - connect(this, SIGNAL(requestedShutdown()), splash, SLOT(close())); + connect(this, &BitcoinApplication::splashFinished, splash, + &SplashScreen::slotFinish); + connect(this, &BitcoinApplication::requestedShutdown, splash, + &QWidget::close); } void BitcoinApplication::startThread() { @@ -379,11 +380,12 @@ executor->moveToThread(coreThread); /* communication to and from thread */ - connect(executor, SIGNAL(initializeResult(bool)), this, - SLOT(initializeResult(bool))); - connect(executor, SIGNAL(shutdownResult()), this, SLOT(shutdownResult())); - connect(executor, SIGNAL(runawayException(QString)), this, - SLOT(handleRunawayException(QString))); + connect(executor, &BitcoinABC::initializeResult, this, + &BitcoinApplication::initializeResult); + connect(executor, &BitcoinABC::shutdownResult, this, + &BitcoinApplication::shutdownResult); + connect(executor, &BitcoinABC::runawayException, this, + &BitcoinApplication::handleRunawayException); // Note on how Qt works: it tries to directly invoke methods if the signal // is emitted on the same thread that the target object 'lives' on. @@ -398,16 +400,15 @@ // temporary (eg it lives somewhere aside from the stack) or this will // crash because initialize() gets executed in another thread at some // unspecified time (after) requestedInitialize() is emitted! - connect(this, - SIGNAL(requestedInitialize(Config *, RPCServer *, - HTTPRPCRequestProcessor *)), - executor, - SLOT(initialize(Config *, RPCServer *, HTTPRPCRequestProcessor *))); + connect(this, &BitcoinApplication::requestedInitialize, executor, + &BitcoinABC::initialize); - connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown())); + connect(this, &BitcoinApplication::requestedShutdown, executor, + &BitcoinABC::shutdown); /* make sure executor object is deleted in its own thread */ - connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater())); - connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit())); + connect(this, &BitcoinApplication::stopThread, executor, + &QObject::deleteLater); + connect(this, &BitcoinApplication::stopThread, coreThread, &QThread::quit); coreThread->start(); } @@ -464,12 +465,10 @@ window->setCurrentWallet(walletModel->getWalletName()); } - connect(walletModel, - SIGNAL(coinsSent(WalletModel *, SendCoinsRecipient, QByteArray)), - paymentServer, - SLOT(fetchPaymentACK(WalletModel *, const SendCoinsRecipient &, - QByteArray))); - connect(walletModel, SIGNAL(unload()), this, SLOT(removeWallet())); + connect(walletModel, &WalletModel::coinsSent, paymentServer, + &PaymentServer::fetchPaymentACK); + connect(walletModel, &WalletModel::unload, this, + &BitcoinApplication::removeWallet); m_wallet_models.push_back(walletModel); #endif @@ -535,13 +534,15 @@ #ifdef ENABLE_WALLET // Now that initialization/startup is done, process any command-line // bitcoincash: URIs or payment requests: - connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), - window, SLOT(handlePaymentRequest(SendCoinsRecipient))); - connect(window, SIGNAL(receivedURI(QString)), paymentServer, - SLOT(handleURIOrFile(QString))); - connect(paymentServer, SIGNAL(message(QString, QString, unsigned int)), - window, SLOT(message(QString, QString, unsigned int))); - QTimer::singleShot(100, paymentServer, SLOT(uiReady())); + connect(paymentServer, &PaymentServer::receivedPaymentRequest, window, + &BitcoinGUI::handlePaymentRequest); + connect(window, &BitcoinGUI::receivedURI, paymentServer, + &PaymentServer::handleURIOrFile); + connect( + paymentServer, &PaymentServer::message, + [this](const QString &title, const QString &message, + unsigned int style) { window->message(title, message, style); }); + QTimer::singleShot(100, paymentServer, &PaymentServer::uiReady); #endif pollShutdownTimer->start(200);