diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 3abef864e3..5191b1d17d 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -369,9 +369,9 @@ void BitcoinGUI::createActions() #ifdef ENABLE_WALLET // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. - connect(sendCoinsMenuAction, &QAction::triggered, this, static_cast(&BitcoinGUI::showNormalIfMinimized)); - connect(coinJoinCoinsMenuAction, &QAction::triggered, this, static_cast(&BitcoinGUI::showNormalIfMinimized)); - connect(receiveCoinsMenuAction, &QAction::triggered, this, static_cast(&BitcoinGUI::showNormalIfMinimized)); + connect(sendCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); + connect(coinJoinCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); + connect(receiveCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); connect(sendCoinsMenuAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); }); connect(coinJoinCoinsMenuAction, &QAction::triggered, [this]{ gotoCoinJoinCoinsPage(); }); connect(receiveCoinsMenuAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage); @@ -506,11 +506,11 @@ void BitcoinGUI::createActions() connect(changePassphraseAction, &QAction::triggered, walletFrame, &WalletFrame::changePassphrase); connect(unlockWalletAction, &QAction::triggered, walletFrame, &WalletFrame::unlockWallet); connect(lockWalletAction, &QAction::triggered, walletFrame, &WalletFrame::lockWallet); - connect(signMessageAction, &QAction::triggered, this, static_cast(&BitcoinGUI::showNormalIfMinimized)); + connect(signMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); connect(signMessageAction, &QAction::triggered, [this]{ gotoSignMessageTab(); }); connect(m_load_psbt_action, &QAction::triggered, [this]{ gotoLoadPSBT(); }); connect(m_load_psbt_clipboard_action, &QAction::triggered, [this]{ gotoLoadPSBT(true); }); - connect(verifyMessageAction, &QAction::triggered, this, static_cast(&BitcoinGUI::showNormalIfMinimized)); + connect(verifyMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); connect(verifyMessageAction, &QAction::triggered, [this]{ gotoVerifyMessageTab(); }); connect(usedSendingAddressesAction, &QAction::triggered, walletFrame, &WalletFrame::usedSendingAddresses); connect(usedReceivingAddressesAction, &QAction::triggered, walletFrame, &WalletFrame::usedReceivingAddresses); @@ -730,7 +730,7 @@ void BitcoinGUI::createToolBars() connect(historyButton, &QToolButton::clicked, this, &BitcoinGUI::gotoHistoryPage); // Give the selected tab button a bolder font. - connect(tabGroup, static_cast(&QButtonGroup::buttonToggled), this, &BitcoinGUI::highlightTabButton); + connect(tabGroup, qOverload(&QButtonGroup::buttonToggled), this, &BitcoinGUI::highlightTabButton); for (auto button : tabGroup->buttons()) { GUIUtil::setFont({button}, GUIUtil::FontWeight::Normal, 16); @@ -799,7 +799,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH // Note: ignore this on Mac - this is not the way tray should work there connect(trayIcon, &QSystemTrayIcon::activated, this, &BitcoinGUI::trayIconActivated); #else - // Note: On Mac, the dock icon is also used to provide menu functionality + // Note: on macOS, the Dock icon is also used to provide menu functionality // similar to one for tray icon MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, this, &BitcoinGUI::macosDockIconActivated); @@ -1019,7 +1019,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu) { // Configuration of the tray icon (or dock icon) icon menu #ifndef Q_OS_MAC - // Note: On Mac, the dock icon's menu already has show / hide action. + // Note: On macOS, the Dock icon is used to provide the tray's functionality. trayIconMenu->addAction(toggleHideAction); trayIconMenu->addSeparator(); #endif @@ -1045,7 +1045,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu) if (enableWallet) { pmenu->addAction(showBackupsAction); } -#ifndef Q_OS_MAC // This is built-in on Mac +#ifndef Q_OS_MAC // This is built-in on macOS pmenu->addSeparator(); pmenu->addAction(quitAction); #endif @@ -1617,7 +1617,7 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty void BitcoinGUI::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); -#ifndef Q_OS_MAC // Ignored on Mac +#ifndef Q_OS_MAC // Ignored on macOS if(e->type() == QEvent::WindowStateChange) { if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray()) @@ -1649,7 +1649,7 @@ void BitcoinGUI::changeEvent(QEvent *e) void BitcoinGUI::closeEvent(QCloseEvent *event) { -#ifndef Q_OS_MAC // Ignored on Mac +#ifndef Q_OS_MAC // Ignored on macOS if(clientModel && clientModel->getOptionsModel()) { if(!clientModel->getOptionsModel()->getMinimizeOnClose())