aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/addressbookpage.cpp1
-rw-r--r--src/qt/addressbookpage.h2
-rw-r--r--src/qt/askpassphrasedialog.cpp2
-rw-r--r--src/qt/askpassphrasedialog.h4
-rw-r--r--src/qt/bitcoin.cpp41
-rw-r--r--src/qt/bitcoin.h12
-rw-r--r--src/qt/bitcoinamountfield.cpp5
-rw-r--r--src/qt/bitcoinamountfield.h2
-rw-r--r--src/qt/bitcoingui.cpp6
-rw-r--r--src/qt/bitcoingui.h4
-rw-r--r--src/qt/clientmodel.cpp2
-rw-r--r--src/qt/clientmodel.h4
-rw-r--r--src/qt/csvmodelwriter.cpp6
-rw-r--r--src/qt/csvmodelwriter.h2
-rw-r--r--src/qt/editaddressdialog.cpp10
-rw-r--r--src/qt/editaddressdialog.h4
-rw-r--r--src/qt/intro.cpp2
-rw-r--r--src/qt/intro.h4
-rw-r--r--src/qt/modaloverlay.cpp11
-rw-r--r--src/qt/modaloverlay.h6
-rw-r--r--src/qt/notificator.cpp4
-rw-r--r--src/qt/notificator.h4
-rw-r--r--src/qt/optionsdialog.cpp8
-rw-r--r--src/qt/optionsdialog.h4
-rw-r--r--src/qt/optionsmodel.cpp4
-rw-r--r--src/qt/overviewpage.cpp17
-rw-r--r--src/qt/overviewpage.h5
-rw-r--r--src/qt/paymentserver.cpp7
-rw-r--r--src/qt/paymentserver.h6
-rw-r--r--src/qt/peertablemodel.cpp7
-rw-r--r--src/qt/peertablemodel.h2
-rw-r--r--src/qt/qrimagewidget.cpp4
-rw-r--r--src/qt/qrimagewidget.h2
-rw-r--r--src/qt/qvalidatedlineedit.cpp6
-rw-r--r--src/qt/qvalidatedlineedit.h4
-rw-r--r--src/qt/qvaluecombobox.cpp4
-rw-r--r--src/qt/qvaluecombobox.h2
-rw-r--r--src/qt/receivecoinsdialog.cpp1
-rw-r--r--src/qt/receivecoinsdialog.h2
-rw-r--r--src/qt/receiverequestdialog.cpp7
-rw-r--r--src/qt/receiverequestdialog.h2
-rw-r--r--src/qt/recentrequeststablemodel.cpp4
-rw-r--r--src/qt/recentrequeststablemodel.h4
-rw-r--r--src/qt/rpcconsole.cpp4
-rw-r--r--src/qt/sendcoinsdialog.cpp4
-rw-r--r--src/qt/sendcoinsdialog.h8
-rw-r--r--src/qt/sendcoinsentry.cpp1
-rw-r--r--src/qt/sendcoinsentry.h2
-rw-r--r--src/qt/signverifymessagedialog.cpp1
-rw-r--r--src/qt/signverifymessagedialog.h2
-rw-r--r--src/qt/splashscreen.cpp2
-rw-r--r--src/qt/splashscreen.h2
-rw-r--r--src/qt/test/wallettests.cpp2
-rw-r--r--src/qt/trafficgraphwidget.cpp13
-rw-r--r--src/qt/trafficgraphwidget.h10
-rw-r--r--src/qt/transactionfilterproxy.cpp29
-rw-r--r--src/qt/transactionfilterproxy.h12
-rw-r--r--src/qt/transactiontablemodel.cpp1
-rw-r--r--src/qt/transactiontablemodel.h2
-rw-r--r--src/qt/walletmodel.cpp4
-rw-r--r--src/qt/walletmodel.h8
-rw-r--r--src/qt/walletmodeltransaction.cpp5
-rw-r--r--src/qt/walletmodeltransaction.h2
-rw-r--r--src/qt/walletview.cpp1
-rw-r--r--src/qt/walletview.h2
65 files changed, 145 insertions, 212 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp
index cc24b7cfcb..b888fc43e2 100644
--- a/src/qt/addressbookpage.cpp
+++ b/src/qt/addressbookpage.cpp
@@ -64,7 +64,6 @@ protected:
AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::AddressBookPage),
- model(nullptr),
mode(_mode),
tab(_tab)
{
diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h
index 144990f419..283209d00c 100644
--- a/src/qt/addressbookpage.h
+++ b/src/qt/addressbookpage.h
@@ -49,7 +49,7 @@ public Q_SLOTS:
private:
Ui::AddressBookPage *ui;
- AddressTableModel *model;
+ AddressTableModel* model{nullptr};
Mode mode;
Tabs tab;
QString returnValue;
diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp
index f16700bfd9..d15aba5cdd 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -23,8 +23,6 @@ AskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent, SecureStri
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::AskPassphraseDialog),
mode(_mode),
- model(nullptr),
- fCapsLock(false),
m_passphrase_out(passphrase_out)
{
ui->setupUi(this);
diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h
index 66031b08d3..370ea1de7e 100644
--- a/src/qt/askpassphrasedialog.h
+++ b/src/qt/askpassphrasedialog.h
@@ -38,8 +38,8 @@ public:
private:
Ui::AskPassphraseDialog *ui;
Mode mode;
- WalletModel *model;
- bool fCapsLock;
+ WalletModel* model{nullptr};
+ bool fCapsLock{false};
SecureString* m_passphrase_out;
private Q_SLOTS:
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index b6720b0433..59f433749d 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -228,14 +228,8 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
static int qt_argc = 1;
static const char* qt_argv = "bitcoin-qt";
-BitcoinApplication::BitcoinApplication():
- QApplication(qt_argc, const_cast<char **>(&qt_argv)),
- optionsModel(nullptr),
- clientModel(nullptr),
- window(nullptr),
- pollShutdownTimer(nullptr),
- returnValue(0),
- platformStyle(nullptr)
+BitcoinApplication::BitcoinApplication()
+ : QApplication(qt_argc, const_cast<char**>(&qt_argv))
{
// Qt runs setlocale(LC_ALL, "") on initialization.
RegisterMetaTypes();
@@ -592,29 +586,30 @@ int GuiMain(int argc, char* argv[])
// Gracefully exit if the user cancels
if (!Intro::showIfNeeded(did_show_intro, prune_MiB)) return EXIT_SUCCESS;
- /// 6. Determine availability of data directory and parse bitcoin.conf
- /// - Do not call gArgs.GetDataDirNet() before this step finishes
+ /// 6a. Determine availability of data directory
if (!CheckDataDirOption()) {
InitError(strprintf(Untranslated("Specified data directory \"%s\" does not exist.\n"), gArgs.GetArg("-datadir", "")));
QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));
return EXIT_FAILURE;
}
- if (!gArgs.ReadConfigFiles(error, true)) {
- InitError(strprintf(Untranslated("Error reading configuration file: %s\n"), error));
- QMessageBox::critical(nullptr, PACKAGE_NAME,
- QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error)));
- return EXIT_FAILURE;
- }
+ try {
+ /// 6b. Parse bitcoin.conf
+ /// - Do not call gArgs.GetDataDirNet() before this step finishes
+ if (!gArgs.ReadConfigFiles(error, true)) {
+ InitError(strprintf(Untranslated("Error reading configuration file: %s\n"), error));
+ QMessageBox::critical(nullptr, PACKAGE_NAME,
+ QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error)));
+ return EXIT_FAILURE;
+ }
- /// 7. Determine network (and switch to network specific options)
- // - Do not call Params() before this step
- // - Do this after parsing the configuration file, as the network can be switched there
- // - QSettings() will use the new application name after this, resulting in network-specific settings
- // - Needs to be done before createOptionsModel
+ /// 7. Determine network (and switch to network specific options)
+ // - Do not call Params() before this step
+ // - Do this after parsing the configuration file, as the network can be switched there
+ // - QSettings() will use the new application name after this, resulting in network-specific settings
+ // - Needs to be done before createOptionsModel
- // Check for chain settings (Params() calls are only valid after this clause)
- try {
+ // Check for chain settings (Params() calls are only valid after this clause)
SelectParams(gArgs.GetChainName());
} catch(std::exception &e) {
InitError(Untranslated(strprintf("%s\n", e.what())));
diff --git a/src/qt/bitcoin.h b/src/qt/bitcoin.h
index 61a18ba6a1..9174e23de6 100644
--- a/src/qt/bitcoin.h
+++ b/src/qt/bitcoin.h
@@ -96,16 +96,16 @@ protected:
private:
std::optional<InitExecutor> m_executor;
- OptionsModel *optionsModel;
- ClientModel *clientModel;
- BitcoinGUI *window;
- QTimer *pollShutdownTimer;
+ OptionsModel* optionsModel{nullptr};
+ ClientModel* clientModel{nullptr};
+ BitcoinGUI* window{nullptr};
+ QTimer* pollShutdownTimer{nullptr};
#ifdef ENABLE_WALLET
PaymentServer* paymentServer{nullptr};
WalletController* m_wallet_controller{nullptr};
#endif
- int returnValue;
- const PlatformStyle *platformStyle;
+ int returnValue{0};
+ const PlatformStyle* platformStyle{nullptr};
std::unique_ptr<QWidget> shutdownWindow;
SplashScreen* m_splash = nullptr;
std::unique_ptr<interfaces::Node> m_node;
diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp
index 765a2a5ffc..a7e2d22488 100644
--- a/src/qt/bitcoinamountfield.cpp
+++ b/src/qt/bitcoinamountfield.cpp
@@ -217,9 +217,8 @@ Q_SIGNALS:
#include <qt/bitcoinamountfield.moc>
-BitcoinAmountField::BitcoinAmountField(QWidget *parent) :
- QWidget(parent),
- amount(nullptr)
+BitcoinAmountField::BitcoinAmountField(QWidget* parent)
+ : QWidget(parent)
{
amount = new AmountSpinBox(this);
amount->setLocale(QLocale::c());
diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h
index a40cd38332..f710915a49 100644
--- a/src/qt/bitcoinamountfield.h
+++ b/src/qt/bitcoinamountfield.h
@@ -74,7 +74,7 @@ protected:
bool eventFilter(QObject *object, QEvent *event) override;
private:
- AmountSpinBox *amount;
+ AmountSpinBox* amount{nullptr};
QValueComboBox *unit;
private Q_SLOTS:
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index a0731b337a..a7ffd367d7 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -1541,10 +1541,8 @@ bool BitcoinGUI::isPrivacyModeActivated() const
return m_mask_values_action->isChecked();
}
-UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *platformStyle)
- : optionsModel(nullptr),
- menu(nullptr),
- m_platform_style{platformStyle}
+UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle* platformStyle)
+ : m_platform_style{platformStyle}
{
createContextMenu();
setToolTip(tr("Unit to show amounts in. Click to select another unit."));
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 9970e87833..1a83057146 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -333,8 +333,8 @@ protected:
void changeEvent(QEvent* e) override;
private:
- OptionsModel *optionsModel;
- QMenu* menu;
+ OptionsModel* optionsModel{nullptr};
+ QMenu* menu{nullptr};
const PlatformStyle* m_platform_style;
/** Shows context menu with Display Unit options by the mouse coordinates */
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 6f53626fd1..c0d1a0e226 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -34,8 +34,6 @@ ClientModel::ClientModel(interfaces::Node& node, OptionsModel *_optionsModel, QO
QObject(parent),
m_node(node),
optionsModel(_optionsModel),
- peerTableModel(nullptr),
- banTableModel(nullptr),
m_thread(new QThread(this))
{
cachedBestHeaderHeight = -1;
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 49ac75452f..9ff64fe772 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -104,9 +104,9 @@ private:
std::unique_ptr<interfaces::Handler> m_handler_notify_block_tip;
std::unique_ptr<interfaces::Handler> m_handler_notify_header_tip;
OptionsModel *optionsModel;
- PeerTableModel *peerTableModel;
+ PeerTableModel* peerTableModel{nullptr};
PeerTableSortProxy* m_peer_table_sort_proxy{nullptr};
- BanTableModel *banTableModel;
+ BanTableModel* banTableModel{nullptr};
//! A thread to interact with m_node asynchronously
QThread* const m_thread;
diff --git a/src/qt/csvmodelwriter.cpp b/src/qt/csvmodelwriter.cpp
index 656afb6e87..445ea41475 100644
--- a/src/qt/csvmodelwriter.cpp
+++ b/src/qt/csvmodelwriter.cpp
@@ -8,9 +8,9 @@
#include <QFile>
#include <QTextStream>
-CSVModelWriter::CSVModelWriter(const QString &_filename, QObject *parent) :
- QObject(parent),
- filename(_filename), model(nullptr)
+CSVModelWriter::CSVModelWriter(const QString& _filename, QObject* parent)
+ : QObject(parent),
+ filename(_filename)
{
}
diff --git a/src/qt/csvmodelwriter.h b/src/qt/csvmodelwriter.h
index ad247b6859..a1e77826a8 100644
--- a/src/qt/csvmodelwriter.h
+++ b/src/qt/csvmodelwriter.h
@@ -32,7 +32,7 @@ public:
private:
QString filename;
- const QAbstractItemModel *model;
+ const QAbstractItemModel* model{nullptr};
struct Column
{
diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp
index fa27635981..9b3319415d 100644
--- a/src/qt/editaddressdialog.cpp
+++ b/src/qt/editaddressdialog.cpp
@@ -12,12 +12,10 @@
#include <QMessageBox>
-EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
- QDialog(parent, GUIUtil::dialog_flags),
- ui(new Ui::EditAddressDialog),
- mapper(nullptr),
- mode(_mode),
- model(nullptr)
+EditAddressDialog::EditAddressDialog(Mode _mode, QWidget* parent)
+ : QDialog(parent, GUIUtil::dialog_flags),
+ ui(new Ui::EditAddressDialog),
+ mode(_mode)
{
ui->setupUi(this);
diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h
index f7ad80bb2d..7bfadcfbcc 100644
--- a/src/qt/editaddressdialog.h
+++ b/src/qt/editaddressdialog.h
@@ -49,9 +49,9 @@ private:
QString getDuplicateAddressWarning() const;
Ui::EditAddressDialog *ui;
- QDataWidgetMapper *mapper;
+ QDataWidgetMapper* mapper{nullptr};
Mode mode;
- AddressTableModel *model;
+ AddressTableModel* model{nullptr};
QString address;
};
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index ea5b1a7242..12aa02340a 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -122,8 +122,6 @@ int GetPruneTargetGB()
Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_size_gb) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::Intro),
- thread(nullptr),
- signalled(false),
m_blockchain_size_gb(blockchain_size_gb),
m_chain_state_size_gb(chain_state_size_gb),
m_prune_target_gb{GetPruneTargetGB()}
diff --git a/src/qt/intro.h b/src/qt/intro.h
index d9c45007e1..900c657b27 100644
--- a/src/qt/intro.h
+++ b/src/qt/intro.h
@@ -64,9 +64,9 @@ private Q_SLOTS:
private:
Ui::Intro *ui;
- QThread *thread;
+ QThread* thread{nullptr};
QMutex mutex;
- bool signalled;
+ bool signalled{false};
QString pathToCheck;
const int64_t m_blockchain_size_gb;
const int64_t m_chain_state_size_gb;
diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp
index 585599141a..b09e230bce 100644
--- a/src/qt/modaloverlay.cpp
+++ b/src/qt/modaloverlay.cpp
@@ -12,13 +12,10 @@
#include <QPropertyAnimation>
#include <QResizeEvent>
-ModalOverlay::ModalOverlay(bool enable_wallet, QWidget *parent) :
-QWidget(parent),
-ui(new Ui::ModalOverlay),
-bestHeaderHeight(0),
-bestHeaderDate(QDateTime()),
-layerIsVisible(false),
-userClosed(false)
+ModalOverlay::ModalOverlay(bool enable_wallet, QWidget* parent)
+ : QWidget(parent),
+ ui(new Ui::ModalOverlay),
+ bestHeaderDate(QDateTime())
{
ui->setupUi(this);
connect(ui->closeButton, &QPushButton::clicked, this, &ModalOverlay::closeClicked);
diff --git a/src/qt/modaloverlay.h b/src/qt/modaloverlay.h
index 8d0c8fbf9a..40e487b249 100644
--- a/src/qt/modaloverlay.h
+++ b/src/qt/modaloverlay.h
@@ -45,11 +45,11 @@ protected:
private:
Ui::ModalOverlay *ui;
- int bestHeaderHeight; //best known height (based on the headers)
+ int bestHeaderHeight{0}; // best known height (based on the headers)
QDateTime bestHeaderDate;
QVector<QPair<qint64, double> > blockProcessTime;
- bool layerIsVisible;
- bool userClosed;
+ bool layerIsVisible{false};
+ bool userClosed{false};
QPropertyAnimation m_animation;
void UpdateHeaderSyncLabel();
void UpdateHeaderPresyncLabel(int height, const QDateTime& blockDate);
diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp
index c97644ad7d..88bc33098a 100644
--- a/src/qt/notificator.cpp
+++ b/src/qt/notificator.cpp
@@ -32,11 +32,7 @@ Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon
QObject(_parent),
parent(_parent),
programName(_programName),
- mode(None),
trayIcon(_trayIcon)
-#ifdef USE_DBUS
- ,interface(nullptr)
-#endif
{
if(_trayIcon && _trayIcon->supportsMessages())
{
diff --git a/src/qt/notificator.h b/src/qt/notificator.h
index ac4bbe5a0c..1fd8181a22 100644
--- a/src/qt/notificator.h
+++ b/src/qt/notificator.h
@@ -61,10 +61,10 @@ private:
UserNotificationCenter /**< Use the 10.8+ User Notification Center (Mac only) */
};
QString programName;
- Mode mode;
+ Mode mode{None};
QSystemTrayIcon *trayIcon;
#ifdef USE_DBUS
- QDBusInterface *interface;
+ QDBusInterface* interface{nullptr};
void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);
#endif
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 9f53fbf429..53b0c3832b 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -31,11 +31,9 @@
#include <QSystemTrayIcon>
#include <QTimer>
-OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
- QDialog(parent, GUIUtil::dialog_flags),
- ui(new Ui::OptionsDialog),
- model(nullptr),
- mapper(nullptr)
+OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
+ : QDialog(parent, GUIUtil::dialog_flags),
+ ui(new Ui::OptionsDialog)
{
ui->setupUi(this);
diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h
index 6cf0d1064f..031e4d3163 100644
--- a/src/qt/optionsdialog.h
+++ b/src/qt/optionsdialog.h
@@ -75,8 +75,8 @@ Q_SIGNALS:
private:
Ui::OptionsDialog *ui;
ClientModel* m_client_model{nullptr};
- OptionsModel *model;
- QDataWidgetMapper *mapper;
+ OptionsModel* model{nullptr};
+ QDataWidgetMapper* mapper{nullptr};
};
#endif // BITCOIN_QT_OPTIONSDIALOG_H
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index cd0a1a19ee..00b7952ca4 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -31,7 +31,7 @@
const char *DEFAULT_GUI_PROXY_HOST = "127.0.0.1";
-static const QString GetDefaultProxyAddress();
+static QString GetDefaultProxyAddress();
/** Map GUI option ID to node setting name. */
static const char* SettingName(OptionsModel::OptionID option)
@@ -308,7 +308,7 @@ static std::string ProxyString(bool is_set, QString ip, QString port)
return is_set ? QString(ip + ":" + port).toStdString() : "";
}
-static const QString GetDefaultProxyAddress()
+static QString GetDefaultProxyAddress()
{
return QString("%1:%2").arg(DEFAULT_GUI_PROXY_HOST).arg(DEFAULT_GUI_PROXY_PORT);
}
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index 3a4861afd4..3cd5f4061c 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -140,8 +140,6 @@ private:
OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) :
QWidget(parent),
ui(new Ui::OverviewPage),
- clientModel(nullptr),
- walletModel(nullptr),
m_platform_style{platformStyle},
txdelegate(new TxViewDelegate(platformStyle, this))
{
@@ -264,7 +262,6 @@ void OverviewPage::setWalletModel(WalletModel *model)
// Set up transaction list
filter.reset(new TransactionFilterProxy());
filter->setSourceModel(model->getTransactionTableModel());
- filter->setLimit(NUM_ITEMS);
filter->setDynamicSortFilter(true);
filter->setSortRole(Qt::EditRole);
filter->setShowInactive(false);
@@ -273,6 +270,10 @@ void OverviewPage::setWalletModel(WalletModel *model)
ui->listTransactions->setModel(filter.get());
ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress);
+ connect(filter.get(), &TransactionFilterProxy::rowsInserted, this, &OverviewPage::LimitTransactionRows);
+ connect(filter.get(), &TransactionFilterProxy::rowsRemoved, this, &OverviewPage::LimitTransactionRows);
+ connect(filter.get(), &TransactionFilterProxy::rowsMoved, this, &OverviewPage::LimitTransactionRows);
+ LimitTransactionRows();
// Keep up to date with wallet
setBalance(model->getCachedBalance());
connect(model, &WalletModel::balanceChanged, this, &OverviewPage::setBalance);
@@ -301,6 +302,16 @@ void OverviewPage::changeEvent(QEvent* e)
QWidget::changeEvent(e);
}
+// Only show most recent NUM_ITEMS rows
+void OverviewPage::LimitTransactionRows()
+{
+ if (filter && ui->listTransactions && ui->listTransactions->model() && filter.get() == ui->listTransactions->model()) {
+ for (int i = 0; i < filter->rowCount(); ++i) {
+ ui->listTransactions->setRowHidden(i, i >= NUM_ITEMS);
+ }
+ }
+}
+
void OverviewPage::updateDisplayUnit()
{
if (walletModel && walletModel->getOptionsModel()) {
diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h
index c03b87c616..5c487ee116 100644
--- a/src/qt/overviewpage.h
+++ b/src/qt/overviewpage.h
@@ -50,8 +50,8 @@ protected:
private:
Ui::OverviewPage *ui;
- ClientModel *clientModel;
- WalletModel *walletModel;
+ ClientModel* clientModel{nullptr};
+ WalletModel* walletModel{nullptr};
bool m_privacy{false};
const PlatformStyle* m_platform_style;
@@ -60,6 +60,7 @@ private:
std::unique_ptr<TransactionFilterProxy> filter;
private Q_SLOTS:
+ void LimitTransactionRows();
void updateDisplayUnit();
void handleTransactionClicked(const QModelIndex &index);
void updateAlerts(const QString &warnings);
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index c6aeea065b..3f9d1b040b 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -126,11 +126,8 @@ bool PaymentServer::ipcSendCommandLine()
return fResult;
}
-PaymentServer::PaymentServer(QObject* parent, bool startLocalServer) :
- QObject(parent),
- saveURIs(true),
- uriServer(nullptr),
- optionsModel(nullptr)
+PaymentServer::PaymentServer(QObject* parent, bool startLocalServer)
+ : QObject(parent)
{
// Install global event filter to catch QFileOpenEvents
// on Mac: sent when you click bitcoin: links
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h
index 08b83244ab..63f4faa772 100644
--- a/src/qt/paymentserver.h
+++ b/src/qt/paymentserver.h
@@ -101,9 +101,9 @@ protected:
bool eventFilter(QObject *object, QEvent *event) override;
private:
- bool saveURIs; // true during startup
- QLocalServer* uriServer;
- OptionsModel *optionsModel;
+ bool saveURIs{true}; // true during startup
+ QLocalServer* uriServer{nullptr};
+ OptionsModel* optionsModel{nullptr};
};
#endif // BITCOIN_QT_PAYMENTSERVER_H
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp
index b4be1b031a..9f47213ed9 100644
--- a/src/qt/peertablemodel.cpp
+++ b/src/qt/peertablemodel.cpp
@@ -14,10 +14,9 @@
#include <QList>
#include <QTimer>
-PeerTableModel::PeerTableModel(interfaces::Node& node, QObject* parent) :
- QAbstractTableModel(parent),
- m_node(node),
- timer(nullptr)
+PeerTableModel::PeerTableModel(interfaces::Node& node, QObject* parent)
+ : QAbstractTableModel(parent),
+ m_node(node)
{
// set up timer for auto refresh
timer = new QTimer(this);
diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h
index e51b152538..a0174c3af4 100644
--- a/src/qt/peertablemodel.h
+++ b/src/qt/peertablemodel.h
@@ -110,7 +110,7 @@ private:
/*: Title of Peers Table column which contains the peer's
User Agent string. */
tr("User Agent")};
- QTimer *timer;
+ QTimer* timer{nullptr};
};
#endif // BITCOIN_QT_PEERTABLEMODEL_H
diff --git a/src/qt/qrimagewidget.cpp b/src/qt/qrimagewidget.cpp
index 05a67117b6..00f928b355 100644
--- a/src/qt/qrimagewidget.cpp
+++ b/src/qt/qrimagewidget.cpp
@@ -23,8 +23,8 @@
#include <qrencode.h>
#endif
-QRImageWidget::QRImageWidget(QWidget *parent):
- QLabel(parent), contextMenu(nullptr)
+QRImageWidget::QRImageWidget(QWidget* parent)
+ : QLabel(parent)
{
contextMenu = new QMenu(this);
contextMenu->addAction(tr("&Save Imageā€¦"), this, &QRImageWidget::saveImage);
diff --git a/src/qt/qrimagewidget.h b/src/qt/qrimagewidget.h
index 5dbba074a1..d9ca2b899f 100644
--- a/src/qt/qrimagewidget.h
+++ b/src/qt/qrimagewidget.h
@@ -41,7 +41,7 @@ protected:
virtual void contextMenuEvent(QContextMenuEvent *event) override;
private:
- QMenu *contextMenu;
+ QMenu* contextMenu{nullptr};
};
#endif // BITCOIN_QT_QRIMAGEWIDGET_H
diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp
index bdb302715b..b646332001 100644
--- a/src/qt/qvalidatedlineedit.cpp
+++ b/src/qt/qvalidatedlineedit.cpp
@@ -7,10 +7,8 @@
#include <qt/bitcoinaddressvalidator.h>
#include <qt/guiconstants.h>
-QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) :
- QLineEdit(parent),
- valid(true),
- checkValidator(nullptr)
+QValidatedLineEdit::QValidatedLineEdit(QWidget* parent)
+ : QLineEdit(parent)
{
connect(this, &QValidatedLineEdit::textChanged, this, &QValidatedLineEdit::markValid);
}
diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h
index 4b1139d8f0..b1ae013957 100644
--- a/src/qt/qvalidatedlineedit.h
+++ b/src/qt/qvalidatedlineedit.h
@@ -25,8 +25,8 @@ protected:
void focusOutEvent(QFocusEvent *evt) override;
private:
- bool valid;
- const QValidator *checkValidator;
+ bool valid{true};
+ const QValidator* checkValidator{nullptr};
public Q_SLOTS:
void setText(const QString&);
diff --git a/src/qt/qvaluecombobox.cpp b/src/qt/qvaluecombobox.cpp
index f94486a2f3..c163ba56dc 100644
--- a/src/qt/qvaluecombobox.cpp
+++ b/src/qt/qvaluecombobox.cpp
@@ -4,8 +4,8 @@
#include <qt/qvaluecombobox.h>
-QValueComboBox::QValueComboBox(QWidget *parent) :
- QComboBox(parent), role(Qt::UserRole)
+QValueComboBox::QValueComboBox(QWidget* parent)
+ : QComboBox(parent)
{
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &QValueComboBox::handleSelectionChanged);
}
diff --git a/src/qt/qvaluecombobox.h b/src/qt/qvaluecombobox.h
index bde9c0d1a6..14379dd612 100644
--- a/src/qt/qvaluecombobox.h
+++ b/src/qt/qvaluecombobox.h
@@ -28,7 +28,7 @@ Q_SIGNALS:
void valueChanged();
private:
- int role;
+ int role{Qt::UserRole};
private Q_SLOTS:
void handleSelectionChanged(int idx);
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index acbe179463..22eb642ecd 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -25,7 +25,6 @@
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::ReceiveCoinsDialog),
- model(nullptr),
platformStyle(_platformStyle)
{
ui->setupUi(this);
diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h
index a089b8aa6a..0bb02ebcf2 100644
--- a/src/qt/receivecoinsdialog.h
+++ b/src/qt/receivecoinsdialog.h
@@ -51,7 +51,7 @@ public Q_SLOTS:
private:
Ui::ReceiveCoinsDialog *ui;
- WalletModel *model;
+ WalletModel* model{nullptr};
QMenu *contextMenu;
QAction* copyLabelAction;
QAction* copyMessageAction;
diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp
index c0135283b1..3453857f98 100644
--- a/src/qt/receiverequestdialog.cpp
+++ b/src/qt/receiverequestdialog.cpp
@@ -18,10 +18,9 @@
#include <config/bitcoin-config.h> /* for USE_QRCODE */
#endif
-ReceiveRequestDialog::ReceiveRequestDialog(QWidget *parent) :
- QDialog(parent, GUIUtil::dialog_flags),
- ui(new Ui::ReceiveRequestDialog),
- model(nullptr)
+ReceiveRequestDialog::ReceiveRequestDialog(QWidget* parent)
+ : QDialog(parent, GUIUtil::dialog_flags),
+ ui(new Ui::ReceiveRequestDialog)
{
ui->setupUi(this);
GUIUtil::handleCloseWindowShortcut(this);
diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h
index c861680761..d64fee3663 100644
--- a/src/qt/receiverequestdialog.h
+++ b/src/qt/receiverequestdialog.h
@@ -33,7 +33,7 @@ private Q_SLOTS:
private:
Ui::ReceiveRequestDialog *ui;
- WalletModel *model;
+ WalletModel* model{nullptr};
SendCoinsRecipient info;
};
diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp
index 85ade624cf..52d4e45d49 100644
--- a/src/qt/recentrequeststablemodel.cpp
+++ b/src/qt/recentrequeststablemodel.cpp
@@ -175,7 +175,7 @@ void RecentRequestsTableModel::addNewRequest(const SendCoinsRecipient &recipient
newEntry.date = QDateTime::currentDateTime();
newEntry.recipient = recipient;
- CDataStream ss(SER_DISK, CLIENT_VERSION);
+ DataStream ss{};
ss << newEntry;
if (!walletModel->wallet().setAddressReceiveRequest(DecodeDestination(recipient.address.toStdString()), ToString(newEntry.id), ss.str()))
@@ -188,7 +188,7 @@ void RecentRequestsTableModel::addNewRequest(const SendCoinsRecipient &recipient
void RecentRequestsTableModel::addNewRequest(const std::string &recipient)
{
std::vector<uint8_t> data(recipient.begin(), recipient.end());
- CDataStream ss(data, SER_DISK, CLIENT_VERSION);
+ DataStream ss{data};
RecentRequestEntry entry;
ss >> entry;
diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h
index cf7cd24ce2..151f8322a8 100644
--- a/src/qt/recentrequeststablemodel.h
+++ b/src/qt/recentrequeststablemodel.h
@@ -18,11 +18,11 @@ class WalletModel;
class RecentRequestEntry
{
public:
- RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION), id(0) { }
+ RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION) {}
static const int CURRENT_VERSION = 1;
int nVersion;
- int64_t id;
+ int64_t id{0};
QDateTime date;
SendCoinsRecipient recipient;
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 843cd46d13..b46a3c039b 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -780,8 +780,8 @@ void RPCConsole::addWallet(WalletModel * const walletModel)
{
// use name for text and wallet model for internal data object (to allow to move to a wallet id later)
ui->WalletSelector->addItem(walletModel->getDisplayName(), QVariant::fromValue(walletModel));
- if (ui->WalletSelector->count() == 2 && !isVisible()) {
- // First wallet added, set to default so long as the window isn't presently visible (and potentially in use)
+ if (ui->WalletSelector->count() == 2) {
+ // First wallet added, set to default to match wallet RPC behavior
ui->WalletSelector->setCurrentIndex(1);
}
if (ui->WalletSelector->count() > 2) {
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 249e3f2101..1604cad503 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -64,11 +64,7 @@ int getIndexForConfTarget(int target) {
SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::SendCoinsDialog),
- clientModel(nullptr),
- model(nullptr),
m_coin_control(new CCoinControl),
- fNewRecipientAllowed(true),
- fFeeMinimized(true),
platformStyle(_platformStyle)
{
ui->setupUi(this);
diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h
index 918e3fd19f..2fcdf5b32a 100644
--- a/src/qt/sendcoinsdialog.h
+++ b/src/qt/sendcoinsdialog.h
@@ -62,12 +62,12 @@ Q_SIGNALS:
private:
Ui::SendCoinsDialog *ui;
- ClientModel *clientModel;
- WalletModel *model;
+ ClientModel* clientModel{nullptr};
+ WalletModel* model{nullptr};
std::unique_ptr<wallet::CCoinControl> m_coin_control;
std::unique_ptr<WalletModelTransaction> m_current_transaction;
- bool fNewRecipientAllowed;
- bool fFeeMinimized;
+ bool fNewRecipientAllowed{true};
+ bool fFeeMinimized{true};
const PlatformStyle *platformStyle;
// Copy PSBT to clipboard and offer to save it.
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index 58d8fb69e3..0536635c84 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -22,7 +22,6 @@
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
QWidget(parent),
ui(new Ui::SendCoinsEntry),
- model(nullptr),
platformStyle(_platformStyle)
{
ui->setupUi(this);
diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h
index 424809b01e..0edc0d1203 100644
--- a/src/qt/sendcoinsentry.h
+++ b/src/qt/sendcoinsentry.h
@@ -73,7 +73,7 @@ protected:
private:
SendCoinsRecipient recipient;
Ui::SendCoinsEntry *ui;
- WalletModel *model;
+ WalletModel* model{nullptr};
const PlatformStyle *platformStyle;
bool updateLabel(const QString &address);
diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp
index 52213a428a..0e725acb33 100644
--- a/src/qt/signverifymessagedialog.cpp
+++ b/src/qt/signverifymessagedialog.cpp
@@ -21,7 +21,6 @@
SignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
QDialog(parent, GUIUtil::dialog_flags),
ui(new Ui::SignVerifyMessageDialog),
- model(nullptr),
platformStyle(_platformStyle)
{
ui->setupUi(this);
diff --git a/src/qt/signverifymessagedialog.h b/src/qt/signverifymessagedialog.h
index 1a3708bf8f..4072707b61 100644
--- a/src/qt/signverifymessagedialog.h
+++ b/src/qt/signverifymessagedialog.h
@@ -35,7 +35,7 @@ protected:
private:
Ui::SignVerifyMessageDialog *ui;
- WalletModel *model;
+ WalletModel* model{nullptr};
const PlatformStyle *platformStyle;
private Q_SLOTS:
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp
index 451a0183c0..096f8a0ded 100644
--- a/src/qt/splashscreen.cpp
+++ b/src/qt/splashscreen.cpp
@@ -28,7 +28,7 @@
SplashScreen::SplashScreen(const NetworkStyle* networkStyle)
- : QWidget(), curAlignment(0)
+ : QWidget()
{
// set reference point, paddings
int paddingRight = 50;
diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h
index df53f625f5..2356bbacd3 100644
--- a/src/qt/splashscreen.h
+++ b/src/qt/splashscreen.h
@@ -57,7 +57,7 @@ private:
QPixmap pixmap;
QString curMessage;
QColor curColor;
- int curAlignment;
+ int curAlignment{0};
interfaces::Node* m_node = nullptr;
bool m_shutdown = false;
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index 59a5934890..15fe37c164 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -289,7 +289,7 @@ void TestGUI(interfaces::Node& node)
std::vector<std::string> requests = walletModel.wallet().getAddressReceiveRequests();
QCOMPARE(requests.size(), size_t{1});
RecentRequestEntry entry;
- CDataStream{MakeUCharSpan(requests[0]), SER_DISK, CLIENT_VERSION} >> entry;
+ DataStream{MakeUCharSpan(requests[0])} >> entry;
QCOMPARE(entry.nVersion, int{1});
QCOMPARE(entry.id, int64_t{1});
QVERIFY(entry.date.isValid());
diff --git a/src/qt/trafficgraphwidget.cpp b/src/qt/trafficgraphwidget.cpp
index 3f27eed3f8..08789c1048 100644
--- a/src/qt/trafficgraphwidget.cpp
+++ b/src/qt/trafficgraphwidget.cpp
@@ -19,15 +19,10 @@
#define XMARGIN 10
#define YMARGIN 10
-TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) :
- QWidget(parent),
- timer(nullptr),
- fMax(0.0f),
- vSamplesIn(),
- vSamplesOut(),
- nLastBytesIn(0),
- nLastBytesOut(0),
- clientModel(nullptr)
+TrafficGraphWidget::TrafficGraphWidget(QWidget* parent)
+ : QWidget(parent),
+ vSamplesIn(),
+ vSamplesOut()
{
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates);
diff --git a/src/qt/trafficgraphwidget.h b/src/qt/trafficgraphwidget.h
index 1cc8fd4adb..5e5557ec82 100644
--- a/src/qt/trafficgraphwidget.h
+++ b/src/qt/trafficgraphwidget.h
@@ -37,14 +37,14 @@ public Q_SLOTS:
private:
void paintPath(QPainterPath &path, QQueue<float> &samples);
- QTimer *timer;
- float fMax;
+ QTimer* timer{nullptr};
+ float fMax{0.0f};
std::chrono::minutes m_range{0};
QQueue<float> vSamplesIn;
QQueue<float> vSamplesOut;
- quint64 nLastBytesIn;
- quint64 nLastBytesOut;
- ClientModel *clientModel;
+ quint64 nLastBytesIn{0};
+ quint64 nLastBytesOut{0};
+ ClientModel* clientModel{nullptr};
};
#endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H
diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp
index 3be7e1a969..173fd326a3 100644
--- a/src/qt/transactionfilterproxy.cpp
+++ b/src/qt/transactionfilterproxy.cpp
@@ -11,14 +11,10 @@
#include <cstdlib>
#include <optional>
-TransactionFilterProxy::TransactionFilterProxy(QObject *parent) :
- QSortFilterProxyModel(parent),
- m_search_string(),
- typeFilter(ALL_TYPES),
- watchOnlyFilter(WatchOnlyFilter_All),
- minAmount(0),
- limitRows(-1),
- showInactive(true)
+TransactionFilterProxy::TransactionFilterProxy(QObject* parent)
+ : QSortFilterProxyModel(parent),
+ m_search_string(),
+ typeFilter(ALL_TYPES)
{
}
@@ -92,25 +88,8 @@ void TransactionFilterProxy::setWatchOnlyFilter(WatchOnlyFilter filter)
invalidateFilter();
}
-void TransactionFilterProxy::setLimit(int limit)
-{
- this->limitRows = limit;
-}
-
void TransactionFilterProxy::setShowInactive(bool _showInactive)
{
this->showInactive = _showInactive;
invalidateFilter();
}
-
-int TransactionFilterProxy::rowCount(const QModelIndex &parent) const
-{
- if(limitRows != -1)
- {
- return std::min(QSortFilterProxyModel::rowCount(parent), limitRows);
- }
- else
- {
- return QSortFilterProxyModel::rowCount(parent);
- }
-}
diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h
index fd9be52842..73c4f21426 100644
--- a/src/qt/transactionfilterproxy.h
+++ b/src/qt/transactionfilterproxy.h
@@ -42,14 +42,9 @@ public:
void setMinAmount(const CAmount& minimum);
void setWatchOnlyFilter(WatchOnlyFilter filter);
- /** Set maximum number of rows returned, -1 if unlimited. */
- void setLimit(int limit);
-
/** Set whether to show conflicted transactions. */
void setShowInactive(bool showInactive);
- int rowCount(const QModelIndex &parent = QModelIndex()) const override;
-
protected:
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override;
@@ -58,10 +53,9 @@ private:
std::optional<QDateTime> dateTo;
QString m_search_string;
quint32 typeFilter;
- WatchOnlyFilter watchOnlyFilter;
- CAmount minAmount;
- int limitRows;
- bool showInactive;
+ WatchOnlyFilter watchOnlyFilter{WatchOnlyFilter_All};
+ CAmount minAmount{0};
+ bool showInactive{true};
};
#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp
index 339b3058f4..3b32137bd4 100644
--- a/src/qt/transactiontablemodel.cpp
+++ b/src/qt/transactiontablemodel.cpp
@@ -253,7 +253,6 @@ TransactionTableModel::TransactionTableModel(const PlatformStyle *_platformStyle
QAbstractTableModel(parent),
walletModel(parent),
priv(new TransactionTablePriv(this)),
- fProcessingQueuedTransactions(false),
platformStyle(_platformStyle)
{
subscribeToCoreSignals();
diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h
index f8576edd59..92ba9bf894 100644
--- a/src/qt/transactiontablemodel.h
+++ b/src/qt/transactiontablemodel.h
@@ -89,7 +89,7 @@ private:
std::unique_ptr<interfaces::Handler> m_handler_show_progress;
QStringList columns;
TransactionTablePriv *priv;
- bool fProcessingQueuedTransactions;
+ bool fProcessingQueuedTransactions{false};
const PlatformStyle *platformStyle;
void subscribeToCoreSignals();
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 097b2b0364..cb8491e27a 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -46,10 +46,6 @@ WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel
m_client_model(&client_model),
m_node(client_model.node()),
optionsModel(client_model.getOptionsModel()),
- addressTableModel(nullptr),
- transactionTableModel(nullptr),
- recentRequestsTableModel(nullptr),
- cachedEncryptionStatus(Unencrypted),
timer(new QTimer(this))
{
fHaveWatchOnly = m_wallet->haveWatchOnly();
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 88a6f3a598..604a9e03c8 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -181,13 +181,13 @@ private:
// (transaction fee, for example)
OptionsModel *optionsModel;
- AddressTableModel *addressTableModel;
- TransactionTableModel *transactionTableModel;
- RecentRequestsTableModel *recentRequestsTableModel;
+ AddressTableModel* addressTableModel{nullptr};
+ TransactionTableModel* transactionTableModel{nullptr};
+ RecentRequestsTableModel* recentRequestsTableModel{nullptr};
// Cache some values to be able to detect changes
interfaces::WalletBalances m_cached_balances;
- EncryptionStatus cachedEncryptionStatus;
+ EncryptionStatus cachedEncryptionStatus{Unencrypted};
QTimer* timer;
// Block hash denoting when the last balance update was done.
diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp
index b579dcc0f0..61ccd9dd82 100644
--- a/src/qt/walletmodeltransaction.cpp
+++ b/src/qt/walletmodeltransaction.cpp
@@ -10,9 +10,8 @@
#include <policy/policy.h>
-WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &_recipients) :
- recipients(_recipients),
- fee(0)
+WalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient>& _recipients)
+ : recipients(_recipients)
{
}
diff --git a/src/qt/walletmodeltransaction.h b/src/qt/walletmodeltransaction.h
index 28fb551364..0e6ed8be49 100644
--- a/src/qt/walletmodeltransaction.h
+++ b/src/qt/walletmodeltransaction.h
@@ -41,7 +41,7 @@ public:
private:
QList<SendCoinsRecipient> recipients;
CTransactionRef wtx;
- CAmount fee;
+ CAmount fee{0};
};
#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index a4cd1a6caf..e62821d5bd 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -31,7 +31,6 @@
WalletView::WalletView(WalletModel* wallet_model, const PlatformStyle* _platformStyle, QWidget* parent)
: QStackedWidget(parent),
- clientModel(nullptr),
walletModel(wallet_model),
platformStyle(_platformStyle)
{
diff --git a/src/qt/walletview.h b/src/qt/walletview.h
index 301084ffa9..ebceef9cf9 100644
--- a/src/qt/walletview.h
+++ b/src/qt/walletview.h
@@ -50,7 +50,7 @@ public:
void showOutOfSyncWarning(bool fShow);
private:
- ClientModel *clientModel;
+ ClientModel* clientModel{nullptr};
//!
//! The wallet model represents a bitcoin wallet, and offers access to