Skip to content

Commit 1551cea

Browse files
committed
refactor: Use override for non-final overriders
1 parent f547532 commit 1551cea

35 files changed

+106
-105
lines changed

src/qt/addressbookpage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
3535
}
3636

3737
protected:
38-
bool filterAcceptsRow(int row, const QModelIndex& parent) const
38+
bool filterAcceptsRow(int row, const QModelIndex& parent) const override
3939
{
4040
auto model = sourceModel();
4141
auto label = model->index(row, AddressTableModel::Label, parent);

src/qt/addressbookpage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AddressBookPage : public QDialog
4545
const QString &getReturnValue() const { return returnValue; }
4646

4747
public Q_SLOTS:
48-
void done(int retval);
48+
void done(int retval) override;
4949

5050
private:
5151
Ui::AddressBookPage *ui;

src/qt/addresstablemodel.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class AddressTableModel : public QAbstractTableModel
5252

5353
/** @name Methods overridden from QAbstractTableModel
5454
@{*/
55-
int rowCount(const QModelIndex &parent) const;
56-
int columnCount(const QModelIndex &parent) const;
57-
QVariant data(const QModelIndex &index, int role) const;
58-
bool setData(const QModelIndex &index, const QVariant &value, int role);
59-
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
60-
QModelIndex index(int row, int column, const QModelIndex &parent) const;
61-
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
62-
Qt::ItemFlags flags(const QModelIndex &index) const;
55+
int rowCount(const QModelIndex &parent) const override;
56+
int columnCount(const QModelIndex &parent) const override;
57+
QVariant data(const QModelIndex &index, int role) const override;
58+
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
59+
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
60+
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
61+
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
62+
Qt::ItemFlags flags(const QModelIndex &index) const override;
6363
/*@}*/
6464

6565
/* Add an address to the model.

src/qt/askpassphrasedialog.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AskPassphraseDialog : public QDialog
3232
explicit AskPassphraseDialog(Mode mode, QWidget *parent, SecureString* passphrase_out = nullptr);
3333
~AskPassphraseDialog();
3434

35-
void accept();
35+
void accept() override;
3636

3737
void setModel(WalletModel *model);
3838

@@ -49,8 +49,8 @@ private Q_SLOTS:
4949
void toggleShowPassword(bool);
5050

5151
protected:
52-
bool event(QEvent *event);
53-
bool eventFilter(QObject *object, QEvent *event);
52+
bool event(QEvent *event) override;
53+
bool eventFilter(QObject *object, QEvent *event) override;
5454
};
5555

5656
#endif // BITCOIN_QT_ASKPASSPHRASEDIALOG_H

src/qt/bantablemodel.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,17 @@ class BanTableModel : public QAbstractTableModel
5656

5757
/** @name Methods overridden from QAbstractTableModel
5858
@{*/
59-
int rowCount(const QModelIndex &parent) const;
60-
int columnCount(const QModelIndex &parent) const;
61-
QVariant data(const QModelIndex &index, int role) const;
62-
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
63-
QModelIndex index(int row, int column, const QModelIndex &parent) const;
64-
Qt::ItemFlags flags(const QModelIndex &index) const;
65-
void sort(int column, Qt::SortOrder order);
66-
bool shouldShow();
59+
int rowCount(const QModelIndex &parent) const override;
60+
int columnCount(const QModelIndex &parent) const override;
61+
QVariant data(const QModelIndex &index, int role) const override;
62+
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
63+
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
64+
Qt::ItemFlags flags(const QModelIndex &index) const override;
65+
void sort(int column, Qt::SortOrder order) override;
6766
/*@}*/
6867

68+
bool shouldShow();
69+
6970
public Q_SLOTS:
7071
void refresh();
7172

src/qt/bitcoinaddressvalidator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BitcoinAddressEntryValidator : public QValidator
1717
public:
1818
explicit BitcoinAddressEntryValidator(QObject *parent);
1919

20-
State validate(QString &input, int &pos) const;
20+
State validate(QString &input, int &pos) const override;
2121
};
2222

2323
/** Bitcoin address widget validator, checks for a valid bitcoin address.
@@ -29,7 +29,7 @@ class BitcoinAddressCheckValidator : public QValidator
2929
public:
3030
explicit BitcoinAddressCheckValidator(QObject *parent);
3131

32-
State validate(QString &input, int &pos) const;
32+
State validate(QString &input, int &pos) const override;
3333
};
3434

3535
#endif // BITCOIN_QT_BITCOINADDRESSVALIDATOR_H

src/qt/bitcoinamountfield.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AmountSpinBox: public QAbstractSpinBox
3131
connect(lineEdit(), &QLineEdit::textEdited, this, &AmountSpinBox::valueChanged);
3232
}
3333

34-
QValidator::State validate(QString &text, int &pos) const
34+
QValidator::State validate(QString &text, int &pos) const override
3535
{
3636
if(text.isEmpty())
3737
return QValidator::Intermediate;
@@ -41,7 +41,7 @@ class AmountSpinBox: public QAbstractSpinBox
4141
return valid ? QValidator::Intermediate : QValidator::Invalid;
4242
}
4343

44-
void fixup(QString &input) const
44+
void fixup(QString &input) const override
4545
{
4646
bool valid;
4747
CAmount val;
@@ -87,7 +87,7 @@ class AmountSpinBox: public QAbstractSpinBox
8787
m_max_amount = value;
8888
}
8989

90-
void stepBy(int steps)
90+
void stepBy(int steps) override
9191
{
9292
bool valid = false;
9393
CAmount val = value(&valid);
@@ -114,7 +114,7 @@ class AmountSpinBox: public QAbstractSpinBox
114114
singleStep = step;
115115
}
116116

117-
QSize minimumSizeHint() const
117+
QSize minimumSizeHint() const override
118118
{
119119
if(cachedMinimumSizeHint.isEmpty())
120120
{
@@ -175,7 +175,7 @@ class AmountSpinBox: public QAbstractSpinBox
175175
}
176176

177177
protected:
178-
bool event(QEvent *event)
178+
bool event(QEvent *event) override
179179
{
180180
if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)
181181
{
@@ -190,7 +190,7 @@ class AmountSpinBox: public QAbstractSpinBox
190190
return QAbstractSpinBox::event(event);
191191
}
192192

193-
StepEnabled stepEnabled() const
193+
StepEnabled stepEnabled() const override
194194
{
195195
if (isReadOnly()) // Disable steps when AmountSpinBox is read-only
196196
return StepNone;

src/qt/bitcoinamountfield.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class BitcoinAmountField: public QWidget
7070

7171
protected:
7272
/** Intercept focus-in event and ',' key presses */
73-
bool eventFilter(QObject *object, QEvent *event);
73+
bool eventFilter(QObject *object, QEvent *event) override;
7474

7575
private:
7676
AmountSpinBox *amount;

src/qt/bitcoingui.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ class BitcoinGUI : public QMainWindow
9999
void unsubscribeFromCoreSignals();
100100

101101
protected:
102-
void changeEvent(QEvent *e);
103-
void closeEvent(QCloseEvent *event);
104-
void showEvent(QShowEvent *event);
105-
void dragEnterEvent(QDragEnterEvent *event);
106-
void dropEvent(QDropEvent *event);
107-
bool eventFilter(QObject *object, QEvent *event);
102+
void changeEvent(QEvent *e) override;
103+
void closeEvent(QCloseEvent *event) override;
104+
void showEvent(QShowEvent *event) override;
105+
void dragEnterEvent(QDragEnterEvent *event) override;
106+
void dropEvent(QDropEvent *event) override;
107+
bool eventFilter(QObject *object, QEvent *event) override;
108108

109109
private:
110110
interfaces::Node& m_node;
@@ -324,7 +324,7 @@ class UnitDisplayStatusBarControl : public QLabel
324324

325325
protected:
326326
/** So that it responds to left-button clicks */
327-
void mousePressEvent(QMouseEvent *event);
327+
void mousePressEvent(QMouseEvent *event) override;
328328

329329
private:
330330
OptionsModel *optionsModel;

src/qt/bitcoinunits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class BitcoinUnits: public QAbstractListModel
9090
/** Unit identifier */
9191
UnitRole = Qt::UserRole
9292
};
93-
int rowCount(const QModelIndex &parent) const;
94-
QVariant data(const QModelIndex &index, int role) const;
93+
int rowCount(const QModelIndex &parent) const override;
94+
QVariant data(const QModelIndex &index, int role) const override;
9595
///@}
9696

9797
static QString removeSpaces(QString text)

0 commit comments

Comments
 (0)