diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -55,7 +55,7 @@ AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) - : QDialog(parent), ui(new Ui::AddressBookPage), model(0), mode(_mode), + : QDialog(parent), ui(new Ui::AddressBookPage), model(nullptr), mode(_mode), tab(_tab) { ui->setupUi(this); diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h --- a/src/qt/addresstablemodel.h +++ b/src/qt/addresstablemodel.h @@ -25,7 +25,7 @@ Q_OBJECT public: - explicit AddressTableModel(WalletModel *parent = 0); + explicit AddressTableModel(WalletModel *parent = nullptr); ~AddressTableModel(); enum ColumnIndex { diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -286,7 +286,7 @@ Qt::ItemFlags AddressTableModel::flags(const QModelIndex &index) const { if (!index.isValid()) { - return 0; + return Qt::NoItemFlags; } AddressTableEntry *rec = static_cast(index.internalPointer()); diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -18,8 +18,8 @@ #include AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent) - : QDialog(parent), ui(new Ui::AskPassphraseDialog), mode(_mode), model(0), - fCapsLock(false) { + : QDialog(parent), ui(new Ui::AskPassphraseDialog), mode(_mode), + model(nullptr), fCapsLock(false) { ui->setupUi(this); ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint()); diff --git a/src/qt/bantablemodel.h b/src/qt/bantablemodel.h --- a/src/qt/bantablemodel.h +++ b/src/qt/bantablemodel.h @@ -43,7 +43,8 @@ Q_OBJECT public: - explicit BanTableModel(interfaces::Node &node, ClientModel *parent = 0); + explicit BanTableModel(interfaces::Node &node, + ClientModel *parent = nullptr); ~BanTableModel(); void startAutoRefresh(); void stopAutoRefresh(); diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -76,7 +76,7 @@ return &cachedBanlist[idx]; } - return 0; + return nullptr; } }; @@ -136,7 +136,7 @@ Qt::ItemFlags BanTableModel::flags(const QModelIndex &index) const { if (!index.isValid()) { - return 0; + return Qt::NoItemFlags; } Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -189,9 +189,9 @@ BitcoinApplication::BitcoinApplication(interfaces::Node &node, int &argc, char **argv) - : QApplication(argc, argv), coreThread(0), m_node(node), optionsModel(0), - clientModel(0), window(0), pollShutdownTimer(0), returnValue(0), - platformStyle(0) { + : QApplication(argc, argv), coreThread(nullptr), m_node(node), + optionsModel(nullptr), clientModel(nullptr), window(nullptr), + pollShutdownTimer(nullptr), returnValue(0), platformStyle(nullptr) { setQuitOnLastWindowClosed(false); } @@ -219,15 +219,15 @@ } delete window; - window = 0; + window = nullptr; #ifdef ENABLE_WALLET delete paymentServer; - paymentServer = 0; + paymentServer = nullptr; #endif delete optionsModel; - optionsModel = 0; + optionsModel = nullptr; delete platformStyle; - platformStyle = 0; + platformStyle = nullptr; } #ifdef ENABLE_WALLET @@ -242,7 +242,8 @@ void BitcoinApplication::createWindow(const Config *config, const NetworkStyle *networkStyle) { - window = new BitcoinGUI(m_node, config, platformStyle, networkStyle, 0); + window = + new BitcoinGUI(m_node, config, platformStyle, networkStyle, nullptr); pollShutdownTimer = new QTimer(window); connect(pollShutdownTimer, &QTimer::timeout, window, @@ -250,7 +251,7 @@ } void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) { - SplashScreen *splash = new SplashScreen(m_node, 0, networkStyle); + SplashScreen *splash = new SplashScreen(m_node, nullptr, networkStyle); // We don't hold a direct pointer to the splash screen after creation, but // the splash screen will take care of deleting itself when slotFinish // happens. @@ -336,7 +337,7 @@ qDebug() << __func__ << ": Requesting shutdown"; startThread(); window->hide(); - window->setClientModel(0); + window->setClientModel(nullptr); pollShutdownTimer->stop(); #ifdef ENABLE_WALLET @@ -344,7 +345,7 @@ m_wallet_controller = nullptr; #endif delete clientModel; - clientModel = 0; + clientModel = nullptr; m_node.startShutdown(); @@ -422,7 +423,7 @@ void BitcoinApplication::handleRunawayException(const QString &message) { QMessageBox::critical( - 0, "Runaway exception", + nullptr, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue " "safely and will quit.") + QString("\n\n") + message); @@ -561,7 +562,7 @@ std::string error; if (!node->parseParameters(argc, argv, error)) { QMessageBox::critical( - 0, QObject::tr(PACKAGE_NAME), + nullptr, QObject::tr(PACKAGE_NAME), QObject::tr("Error parsing command line arguments: %1.") .arg(QString::fromStdString(error))); return EXIT_FAILURE; @@ -611,7 +612,7 @@ /// - Do not call GetDataDir(true) before this step finishes. if (!fs::is_directory(GetDataDir(false))) { QMessageBox::critical( - 0, QObject::tr(PACKAGE_NAME), + nullptr, QObject::tr(PACKAGE_NAME), QObject::tr( "Error: Specified data directory \"%1\" does not exist.") .arg(QString::fromStdString(gArgs.GetArg("-datadir", "")))); @@ -619,7 +620,7 @@ } if (!node->readConfigFiles(error)) { QMessageBox::critical( - 0, QObject::tr(PACKAGE_NAME), + nullptr, QObject::tr(PACKAGE_NAME), QObject::tr("Error: Cannot parse configuration file: %1.") .arg(QString::fromStdString(error))); return EXIT_FAILURE; @@ -638,7 +639,7 @@ try { node->selectParams(gArgs.GetChainName()); } catch (std::exception &e) { - QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), + QMessageBox::critical(nullptr, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what())); return EXIT_FAILURE; } diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -24,9 +24,9 @@ Amount value READ value WRITE setValue NOTIFY valueChanged USER true) public: - explicit BitcoinAmountField(QWidget *parent = 0); + explicit BitcoinAmountField(QWidget *parent = nullptr); - Amount value(bool *value = 0) const; + Amount value(bool *value = nullptr) const; void setValue(const Amount value); /** Set single step in satoshis **/ diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -52,7 +52,9 @@ } } - Amount value(bool *valid_out = 0) const { return parse(text(), valid_out); } + Amount value(bool *valid_out = nullptr) const { + return parse(text(), valid_out); + } void setValue(const Amount value) { lineEdit()->setText(BitcoinUnits::format( @@ -134,7 +136,7 @@ * return validity. * @note Must return 0 if !valid. */ - Amount parse(const QString &text, bool *valid_out = 0) const { + Amount parse(const QString &text, bool *valid_out = nullptr) const { Amount val = Amount::zero(); bool valid = BitcoinUnits::parse(currentUnit, text, &val); if (valid) { @@ -174,7 +176,7 @@ return StepUpEnabled; } - StepEnabled rv = 0; + StepEnabled rv = StepNone; bool valid = false; Amount val = value(&valid); if (valid) { @@ -195,7 +197,7 @@ #include BitcoinAmountField::BitcoinAmountField(QWidget *parent) - : QWidget(parent), amount(0) { + : QWidget(parent), amount(nullptr) { amount = new AmountSpinBox(this); amount->setLocale(QLocale::c()); amount->installEventFilter(this); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -68,7 +68,8 @@ explicit BitcoinGUI(interfaces::Node &node, const Config *, const PlatformStyle *platformStyle, - const NetworkStyle *networkStyle, QWidget *parent = 0); + const NetworkStyle *networkStyle, + QWidget *parent = nullptr); ~BitcoinGUI(); /** diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -89,7 +89,7 @@ setWindowIcon(m_network_style->getTrayAndWindowIcon()); updateWindowTitle(); - rpcConsole = new RPCConsole(node, _platformStyle, 0); + rpcConsole = new RPCConsole(node, _platformStyle, nullptr); helpMessageDialog = new HelpMessageDialog(node, this, false); #ifdef ENABLE_WALLET if (enableWallet) { @@ -1286,7 +1286,7 @@ bool proxy_enabled = clientModel->getProxyInfo(ip_port); if (proxy_enabled) { - if (labelProxyIcon->pixmap() == 0) { + if (labelProxyIcon->pixmap() == nullptr) { QString ip_port_q = QString::fromStdString(ip_port); labelProxyIcon->setPixmap( platformStyle->SingleColorIcon(":/icons/proxy") @@ -1346,7 +1346,7 @@ progressDialog = new QProgressDialog(title, "", 0, 100); progressDialog->setWindowModality(Qt::ApplicationModal); progressDialog->setMinimumDuration(0); - progressDialog->setCancelButton(0); + progressDialog->setCancelButton(nullptr); progressDialog->setAutoClose(false); progressDialog->setValue(0); } else if (progressDialog) { @@ -1412,7 +1412,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl( const PlatformStyle *platformStyle) - : optionsModel(0), menu(0) { + : optionsModel(nullptr), menu(nullptr) { createContextMenu(); setToolTip(tr("Unit to show amounts in. Click to select another unit.")); QList units = BitcoinUnits::availableUnits(); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -41,7 +41,7 @@ }; explicit ClientModel(interfaces::Node &node, OptionsModel *optionsModel, - QObject *parent = 0); + QObject *parent = nullptr); ~ClientModel(); interfaces::Node &node() const { return m_node; } diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -34,7 +34,7 @@ ClientModel::ClientModel(interfaces::Node &node, OptionsModel *_optionsModel, QObject *parent) : QObject(parent), m_node(node), optionsModel(_optionsModel), - peerTableModel(0), banTableModel(0), pollTimer(0) { + peerTableModel(nullptr), banTableModel(nullptr), pollTimer(nullptr) { cachedBestHeaderHeight = -1; cachedBestHeaderTime = -1; peerTableModel = new PeerTableModel(m_node, this); diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -44,7 +44,7 @@ public: explicit CoinControlDialog(const PlatformStyle *platformStyle, - QWidget *parent = 0); + QWidget *parent = nullptr); ~CoinControlDialog(); void setModel(WalletModel *model); diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -51,7 +51,7 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidget *parent) - : QDialog(parent), ui(new Ui::CoinControlDialog), model(0), + : QDialog(parent), ui(new Ui::CoinControlDialog), model(nullptr), platformStyle(_platformStyle) { ui->setupUi(this); diff --git a/src/qt/coincontroltreewidget.h b/src/qt/coincontroltreewidget.h --- a/src/qt/coincontroltreewidget.h +++ b/src/qt/coincontroltreewidget.h @@ -12,7 +12,7 @@ Q_OBJECT public: - explicit CoinControlTreeWidget(QWidget *parent = 0); + explicit CoinControlTreeWidget(QWidget *parent = nullptr); protected: virtual void keyPressEvent(QKeyEvent *event) override; diff --git a/src/qt/csvmodelwriter.h b/src/qt/csvmodelwriter.h --- a/src/qt/csvmodelwriter.h +++ b/src/qt/csvmodelwriter.h @@ -20,7 +20,7 @@ Q_OBJECT public: - explicit CSVModelWriter(const QString &filename, QObject *parent = 0); + explicit CSVModelWriter(const QString &filename, QObject *parent = nullptr); void setModel(const QAbstractItemModel *model); void addColumn(const QString &title, int column, int role = Qt::EditRole); diff --git a/src/qt/csvmodelwriter.cpp b/src/qt/csvmodelwriter.cpp --- a/src/qt/csvmodelwriter.cpp +++ b/src/qt/csvmodelwriter.cpp @@ -9,7 +9,7 @@ #include CSVModelWriter::CSVModelWriter(const QString &_filename, QObject *parent) - : QObject(parent), filename(_filename), model(0) {} + : QObject(parent), filename(_filename), model(nullptr) {} void CSVModelWriter::setModel(const QAbstractItemModel *_model) { this->model = _model; diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp --- a/src/qt/editaddressdialog.cpp +++ b/src/qt/editaddressdialog.cpp @@ -12,8 +12,8 @@ #include EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) - : QDialog(parent), ui(new Ui::EditAddressDialog), mapper(0), mode(_mode), - model(0) { + : QDialog(parent), ui(new Ui::EditAddressDialog), mapper(nullptr), + mode(_mode), model(nullptr) { ui->setupUi(this); GUIUtil::setupAddressWidget(ui->addressEdit, this); diff --git a/src/qt/intro.h b/src/qt/intro.h --- a/src/qt/intro.h +++ b/src/qt/intro.h @@ -29,7 +29,7 @@ Q_OBJECT public: - explicit Intro(QWidget *parent = 0); + explicit Intro(QWidget *parent = nullptr); ~Intro(); QString getDataDirectory(); diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -118,7 +118,7 @@ } Intro::Intro(QWidget *parent) - : QDialog(parent), ui(new Ui::Intro), thread(0), signalled(false) { + : QDialog(parent), ui(new Ui::Intro), thread(nullptr), signalled(false) { ui->setupUi(this); ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); @@ -222,7 +222,7 @@ } break; } catch (const fs::filesystem_error &) { - QMessageBox::critical(0, tr(PACKAGE_NAME), + QMessageBox::critical(nullptr, tr(PACKAGE_NAME), tr("Error: Specified data directory " "\"%1\" cannot be created.") .arg(dataDir)); @@ -285,7 +285,7 @@ void Intro::on_ellipsisButton_clicked() { QString dir = QDir::toNativeSeparators(QFileDialog::getExistingDirectory( - 0, "Choose data directory", ui->dataDirectory->text())); + nullptr, "Choose data directory", ui->dataDirectory->text())); if (!dir.isEmpty()) { ui->dataDirectory->setText(dir); } diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -82,5 +82,5 @@ network_styles[x].titleAddText); } } - return 0; + return nullptr; } diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -26,7 +26,8 @@ #include OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) - : QDialog(parent), ui(new Ui::OptionsDialog), model(0), mapper(0) { + : QDialog(parent), ui(new Ui::OptionsDialog), model(nullptr), + mapper(nullptr) { ui->setupUi(this); /* Main elements init */ diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -30,7 +30,7 @@ Q_OBJECT public: - explicit OptionsModel(interfaces::Node &node, QObject *parent = 0, + explicit OptionsModel(interfaces::Node &node, QObject *parent = nullptr, bool resetSettings = false); enum OptionID { diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -30,7 +30,7 @@ public: explicit OverviewPage(const PlatformStyle *platformStyle, - QWidget *parent = 0); + QWidget *parent = nullptr); ~OverviewPage(); void setClientModel(ClientModel *clientModel); diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -115,7 +115,8 @@ #include OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) - : QWidget(parent), ui(new Ui::OverviewPage), clientModel(0), walletModel(0), + : QWidget(parent), ui(new Ui::OverviewPage), clientModel(nullptr), + walletModel(nullptr), txdelegate(new TxViewDelegate(platformStyle, this)) { ui->setupUi(this); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -227,10 +227,10 @@ } PaymentServer::PaymentServer(QObject *parent, bool startLocalServer) - : QObject(parent), saveURIs(true), uriServer(0), optionsModel(0) + : QObject(parent), saveURIs(true), uriServer(nullptr), optionsModel(nullptr) // clang-format off #ifdef ENABLE_BIP70 - ,netManager(0) + ,netManager(nullptr) #endif // clang-format on { @@ -258,7 +258,7 @@ if (!uriServer->listen(name)) { // constructor is called early in init, so don't use "Q_EMIT // message()" here - QMessageBox::critical(0, tr("Payment request error"), + QMessageBox::critical(nullptr, tr("Payment request error"), tr("Cannot start click-to-pay handler")); } else { connect(uriServer, &QLocalServer::newConnection, this, diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -50,7 +50,8 @@ Q_OBJECT public: - explicit PeerTableModel(interfaces::Node &node, ClientModel *parent = 0); + explicit PeerTableModel(interfaces::Node &node, + ClientModel *parent = nullptr); ~PeerTableModel(); const CNodeCombinedStats *getNodeStats(int idx); int getRowByNodeId(NodeId nodeid); diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -97,12 +97,13 @@ return &cachedNodeStats[idx]; } - return 0; + return nullptr; } }; PeerTableModel::PeerTableModel(interfaces::Node &node, ClientModel *parent) - : QAbstractTableModel(parent), m_node(node), clientModel(parent), timer(0) { + : QAbstractTableModel(parent), m_node(node), clientModel(parent), + timer(nullptr) { columns << tr("NodeId") << tr("Node/Service") << tr("Ping") << tr("Sent") << tr("Received") << tr("User Agent"); priv.reset(new PeerTablePriv()); @@ -187,7 +188,7 @@ Qt::ItemFlags PeerTableModel::flags(const QModelIndex &index) const { if (!index.isValid()) { - return 0; + return Qt::NoItemFlags; } Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; diff --git a/src/qt/platformstyle.cpp b/src/qt/platformstyle.cpp --- a/src/qt/platformstyle.cpp +++ b/src/qt/platformstyle.cpp @@ -129,5 +129,5 @@ platform_styles[x].useExtraSpacing); } } - return 0; + return nullptr; } diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp --- a/src/qt/qvalidatedlineedit.cpp +++ b/src/qt/qvalidatedlineedit.cpp @@ -8,7 +8,7 @@ #include QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) - : QLineEdit(parent), valid(true), checkValidator(0) { + : QLineEdit(parent), valid(true), checkValidator(nullptr) { connect(this, &QValidatedLineEdit::textChanged, this, &QValidatedLineEdit::markValid); } diff --git a/src/qt/qvaluecombobox.h b/src/qt/qvaluecombobox.h --- a/src/qt/qvaluecombobox.h +++ b/src/qt/qvaluecombobox.h @@ -17,7 +17,7 @@ QVariant value READ value WRITE setValue NOTIFY valueChanged USER true) public: - explicit QValueComboBox(QWidget *parent = 0); + explicit QValueComboBox(QWidget *parent = nullptr); QVariant value() const; void setValue(const QVariant &value); diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -39,7 +39,7 @@ }; explicit ReceiveCoinsDialog(const PlatformStyle *platformStyle, - QWidget *parent = 0); + QWidget *parent = nullptr); ~ReceiveCoinsDialog(); void setModel(WalletModel *model); diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -26,8 +26,9 @@ ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) - : QDialog(parent), ui(new Ui::ReceiveCoinsDialog), columnResizingFixer(0), - model(0), platformStyle(_platformStyle) { + : QDialog(parent), ui(new Ui::ReceiveCoinsDialog), + columnResizingFixer(nullptr), model(nullptr), + platformStyle(_platformStyle) { ui->setupUi(this); if (!_platformStyle->getImagesOnButtons()) { diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -28,7 +28,7 @@ Q_OBJECT public: - explicit QRImageWidget(QWidget *parent = 0); + explicit QRImageWidget(QWidget *parent = nullptr); QImage exportImage(); public Q_SLOTS: @@ -47,7 +47,7 @@ Q_OBJECT public: - explicit ReceiveRequestDialog(QWidget *parent = 0); + explicit ReceiveRequestDialog(QWidget *parent = nullptr); ~ReceiveRequestDialog(); void setModel(WalletModel *model); diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -27,7 +27,8 @@ #include #endif -QRImageWidget::QRImageWidget(QWidget *parent) : QLabel(parent), contextMenu(0) { +QRImageWidget::QRImageWidget(QWidget *parent) + : QLabel(parent), contextMenu(nullptr) { contextMenu = new QMenu(this); QAction *saveImageAction = new QAction(tr("&Save Image..."), this); connect(saveImageAction, &QAction::triggered, this, @@ -86,7 +87,7 @@ } ReceiveRequestDialog::ReceiveRequestDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::ReceiveRequestDialog), model(0) { + : QDialog(parent), ui(new Ui::ReceiveRequestDialog), model(nullptr) { ui->setupUi(this); #ifndef USE_QRCODE diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -560,7 +560,7 @@ // set library version labels #ifdef ENABLE_WALLET - ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0)); + ui->berkeleyDBVersion->setText(DbEnv::version(nullptr, nullptr, nullptr)); #else ui->label_berkeleyDBVersion->hide(); ui->berkeleyDBVersion->hide(); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -469,7 +469,7 @@ } void SendCoinsDialog::updateTabsAndLabels() { - setupTabChain(0); + setupTabChain(nullptr); coinControlUpdateLabels(); } diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -172,7 +172,7 @@ } // Sending a zero amount is invalid - if (ui->payAmount->value(0) <= Amount::zero()) { + if (ui->payAmount->value(nullptr) <= Amount::zero()) { ui->payAmount->setValid(false); retval = false; } diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp --- a/src/qt/signverifymessagedialog.cpp +++ b/src/qt/signverifymessagedialog.cpp @@ -20,7 +20,7 @@ SignVerifyMessageDialog::SignVerifyMessageDialog( const PlatformStyle *_platformStyle, QWidget *parent) - : QDialog(parent), ui(new Ui::SignVerifyMessageDialog), model(0), + : QDialog(parent), ui(new Ui::SignVerifyMessageDialog), model(nullptr), platformStyle(_platformStyle) { ui->setupUi(this); diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -28,7 +28,7 @@ SplashScreen::SplashScreen(interfaces::Node &node, Qt::WindowFlags f, const NetworkStyle *networkStyle) - : QWidget(0, f), curAlignment(0), m_node(node) { + : QWidget(nullptr, f), curAlignment(0), m_node(node) { // set reference point, paddings int paddingRight = 50; int paddingTop = 50; diff --git a/src/qt/trafficgraphwidget.h b/src/qt/trafficgraphwidget.h --- a/src/qt/trafficgraphwidget.h +++ b/src/qt/trafficgraphwidget.h @@ -19,7 +19,7 @@ Q_OBJECT public: - explicit TrafficGraphWidget(QWidget *parent = 0); + explicit TrafficGraphWidget(QWidget *parent = nullptr); void setClientModel(ClientModel *model); int getGraphRangeMins() const; diff --git a/src/qt/trafficgraphwidget.cpp b/src/qt/trafficgraphwidget.cpp --- a/src/qt/trafficgraphwidget.cpp +++ b/src/qt/trafficgraphwidget.cpp @@ -19,8 +19,8 @@ #define YMARGIN 10 TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) - : QWidget(parent), timer(0), fMax(0.0f), nMins(0), vSamplesIn(), - vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(0) { + : QWidget(parent), timer(nullptr), fMax(0.0f), nMins(0), vSamplesIn(), + vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(nullptr) { timer = new QTimer(this); connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates); } diff --git a/src/qt/transactiondescdialog.h b/src/qt/transactiondescdialog.h --- a/src/qt/transactiondescdialog.h +++ b/src/qt/transactiondescdialog.h @@ -20,7 +20,8 @@ Q_OBJECT public: - explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0); + explicit TransactionDescDialog(const QModelIndex &idx, + QWidget *parent = nullptr); ~TransactionDescDialog(); private: diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -17,7 +17,7 @@ Q_OBJECT public: - explicit TransactionFilterProxy(QObject *parent = 0); + explicit TransactionFilterProxy(QObject *parent = nullptr); /** * Earliest date that can be represented (far in the past). diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -29,7 +29,7 @@ public: explicit TransactionTableModel(const PlatformStyle *platformStyle, - WalletModel *parent = 0); + WalletModel *parent = nullptr); ~TransactionTableModel(); enum ColumnIndex { diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -193,7 +193,7 @@ } return rec; } - return 0; + return nullptr; } QString describe(interfaces::Node &node, interfaces::Wallet &wallet, diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -36,7 +36,7 @@ public: explicit TransactionView(const PlatformStyle *platformStyle, - QWidget *parent = 0); + QWidget *parent = nullptr); void setModel(WalletModel *model); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -37,8 +37,9 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) - : QWidget(parent), model(0), transactionProxyModel(0), transactionView(0), - abandonAction(0), columnResizingFixer(0) { + : QWidget(parent), model(nullptr), transactionProxyModel(nullptr), + transactionView(nullptr), abandonAction(nullptr), + columnResizingFixer(nullptr) { // Build filter row setContentsMargins(0, 0, 0, 0); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -33,8 +33,8 @@ const PlatformStyle *platformStyle, OptionsModel *_optionsModel, QObject *parent) : QObject(parent), m_wallet(std::move(wallet)), m_node(node), - optionsModel(_optionsModel), addressTableModel(0), - transactionTableModel(0), recentRequestsTableModel(0), + optionsModel(_optionsModel), addressTableModel(nullptr), + transactionTableModel(nullptr), recentRequestsTableModel(nullptr), cachedEncryptionStatus(Unencrypted), cachedNumBlocks(0) { fHaveWatchOnly = m_wallet->haveWatchOnly(); addressTableModel = new AddressTableModel(this); diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp --- a/src/test/allocator_tests.cpp +++ b/src/test/allocator_tests.cpp @@ -114,14 +114,14 @@ // Go entirely wild: free and alloc interleaved, generate targets and sizes // using pseudo-randomness. for (int x = 0; x < 2048; ++x) { - addr.push_back(0); + addr.push_back(nullptr); } uint32_t s = 0x12345678; for (int x = 0; x < 5000; ++x) { int idx = s & (addr.size() - 1); if (s & 0x80000000) { b.free(addr[idx]); - addr[idx] = 0; + addr[idx] = nullptr; } else if (!addr[idx]) { addr[idx] = b.alloc((s >> 16) & 2047); } @@ -159,7 +159,7 @@ // Fake address, do not actually use this memory return reinterpret_cast(0x08000000 + (count << 24)); } - return 0; + return nullptr; } void FreeLocked(void *addr, size_t len) override {} size_t GetLimit() override { return std::numeric_limits::max(); } diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -398,7 +398,8 @@ GetWalletEnv(file_path, walletFile); fs::path walletDir = env->Directory(); - LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0)); + LogPrintf("Using BerkeleyDB version %s\n", + DbEnv::version(nullptr, nullptr, nullptr)); LogPrintf("Using wallet %s\n", walletFile); // Wallet file must be a plain filename without a directory