Skip to content

Commit 73f9fcb

Browse files
committed
bitcoin#18914: Apply override specifier consistently
1 parent a8aee57 commit 73f9fcb

33 files changed

+99
-98
lines changed

src/qt/addressbookpage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
3838
}
3939

4040
protected:
41-
bool filterAcceptsRow(int row, const QModelIndex& parent) const
41+
bool filterAcceptsRow(int row, const QModelIndex& parent) const override
4242
{
4343
auto model = sourceModel();
4444
auto label = model->index(row, AddressTableModel::Label, parent);

src/qt/addressbookpage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AddressBookPage : public QDialog
4444
const QString &getReturnValue() const { return returnValue; }
4545

4646
public Q_SLOTS:
47-
void done(int retval);
47+
void done(int retval) override;
4848

4949
private:
5050
Ui::AddressBookPage *ui;

src/qt/addresstablemodel.h

+8-8
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AskPassphraseDialog : public QDialog
3131
explicit AskPassphraseDialog(Mode mode, QWidget *parent);
3232
~AskPassphraseDialog();
3333

34-
void accept();
34+
void accept() override;
3535

3636
void setModel(WalletModel *model);
3737

@@ -47,8 +47,8 @@ private Q_SLOTS:
4747
void toggleShowPassword(bool);
4848

4949
protected:
50-
bool event(QEvent *event);
51-
bool eventFilter(QObject *object, QEvent *event);
50+
bool event(QEvent *event) override;
51+
bool eventFilter(QObject *object, QEvent *event) override;
5252
};
5353

5454
#endif // BITCOIN_QT_ASKPASSPHRASEDIALOG_H

src/qt/bantablemodel.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,17 @@ class BanTableModel : public QAbstractTableModel
5757

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

69+
bool shouldShow();
70+
7071
public Q_SLOTS:
7172
void refresh();
7273

src/qt/bitcoinaddressvalidator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BitcoinAddressEntryValidator : public QValidator
1717
public:
1818
explicit BitcoinAddressEntryValidator(QObject *parent, bool fAllowURI = false);
1919

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

2222
private:
2323
bool fAllowURI;
@@ -32,7 +32,7 @@ class BitcoinAddressCheckValidator : public QValidator
3232
public:
3333
explicit BitcoinAddressCheckValidator(QObject *parent);
3434

35-
State validate(QString &input, int &pos) const;
35+
State validate(QString &input, int &pos) const override;
3636
};
3737

3838
#endif // BITCOIN_QT_BITCOINADDRESSVALIDATOR_H

src/qt/bitcoinamountfield.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class AmountValidator : public QValidator
4343
QValidator(parent),
4444
currentUnit(BitcoinUnits::DASH) {}
4545

46-
State validate(QString &input, int &pos) const
46+
State validate(QString &input, int &pos) const override
4747
{
4848
if(input.isEmpty())
4949
return QValidator::Intermediate;
@@ -112,7 +112,7 @@ class AmountLineEdit: public QLineEdit
112112
clear();
113113
}
114114

115-
QSize minimumSizeHint() const
115+
QSize minimumSizeHint() const override
116116
{
117117
ensurePolished();
118118
const QFontMetrics fm(fontMetrics());
@@ -127,7 +127,7 @@ class AmountLineEdit: public QLineEdit
127127
int currentUnit;
128128

129129
protected:
130-
bool event(QEvent *event)
130+
bool event(QEvent *event) override
131131
{
132132
if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)
133133
{

src/qt/bitcoinamountfield.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class BitcoinAmountField: public QWidget
6060

6161
protected:
6262
/** Intercept focus-in event and ',' key presses */
63-
bool eventFilter(QObject *object, QEvent *event);
63+
bool eventFilter(QObject *object, QEvent *event) override;
6464

6565
private:
6666
AmountLineEdit *amount;

src/qt/bitcoingui.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ class BitcoinGUI : public QMainWindow
8282
bool enableWallet;
8383

8484
protected:
85-
void changeEvent(QEvent *e);
86-
void closeEvent(QCloseEvent *event);
87-
void showEvent(QShowEvent *event);
88-
void dragEnterEvent(QDragEnterEvent *event);
89-
void dropEvent(QDropEvent *event);
90-
bool eventFilter(QObject *object, QEvent *event);
85+
void changeEvent(QEvent *e) override;
86+
void closeEvent(QCloseEvent *event) override;
87+
void showEvent(QShowEvent *event) override;
88+
void dragEnterEvent(QDragEnterEvent *event) override;
89+
void dropEvent(QDropEvent *event) override;
90+
bool eventFilter(QObject *object, QEvent *event) override;
9191

9292
private:
9393
interfaces::Node& m_node;
@@ -360,7 +360,7 @@ class UnitDisplayStatusBarControl : public QLabel
360360

361361
protected:
362362
/** So that it responds to left-button clicks */
363-
void mousePressEvent(QMouseEvent *event);
363+
void mousePressEvent(QMouseEvent *event) override;
364364

365365
private:
366366
OptionsModel *optionsModel;

src/qt/bitcoinunits.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class BitcoinUnits: public QAbstractListModel
109109
/** Unit identifier */
110110
UnitRole = Qt::UserRole
111111
};
112-
int rowCount(const QModelIndex &parent) const;
113-
QVariant data(const QModelIndex &index, int role) const;
112+
int rowCount(const QModelIndex &parent) const override;
113+
QVariant data(const QModelIndex &index, int role) const override;
114114
QVariant data(const int &row, int role) const;
115115
///@}
116116

src/qt/coincontroldialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CCoinControlWidgetItem : public QTreeWidgetItem
3333
explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
3434
explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
3535

36-
bool operator<(const QTreeWidgetItem &other) const;
36+
bool operator<(const QTreeWidgetItem &other) const override;
3737
};
3838

3939

src/qt/editaddressdialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class EditAddressDialog : public QDialog
4040
void setAddress(const QString &address);
4141

4242
public Q_SLOTS:
43-
void accept();
43+
void accept() override;
4444

4545
private:
4646
bool saveCurrentRow();

src/qt/guiutil.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ namespace GUIUtil
205205
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
206206

207207
protected:
208-
bool eventFilter(QObject *obj, QEvent *evt);
208+
bool eventFilter(QObject *obj, QEvent *evt) override;
209209

210210
private:
211211
int size_threshold;
@@ -413,7 +413,7 @@ namespace GUIUtil
413413
*/
414414
void clicked(const QPoint& point);
415415
protected:
416-
void mouseReleaseEvent(QMouseEvent *event);
416+
void mouseReleaseEvent(QMouseEvent *event) override;
417417
};
418418

419419
class ClickableProgressBar : public QProgressBar
@@ -426,7 +426,7 @@ namespace GUIUtil
426426
*/
427427
void clicked(const QPoint& point);
428428
protected:
429-
void mouseReleaseEvent(QMouseEvent *event);
429+
void mouseReleaseEvent(QMouseEvent *event) override;
430430
};
431431

432432
typedef ClickableProgressBar ProgressBar;
@@ -441,7 +441,7 @@ namespace GUIUtil
441441
void keyEscapePressed();
442442

443443
private:
444-
bool eventFilter(QObject *object, QEvent *event);
444+
bool eventFilter(QObject *object, QEvent *event) override;
445445
};
446446
} // namespace GUIUtil
447447

src/qt/modaloverlay.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public Q_SLOTS:
3636
bool isLayerVisible() const { return layerIsVisible; }
3737

3838
protected:
39-
bool eventFilter(QObject * obj, QEvent * ev);
40-
bool event(QEvent* ev);
39+
bool eventFilter(QObject * obj, QEvent * ev) override;
40+
bool event(QEvent* ev) override;
4141

4242
private:
4343
Ui::ModalOverlay *ui;

src/qt/openuridialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class OpenURIDialog : public QDialog
2222
QString getURI();
2323

2424
protected Q_SLOTS:
25-
void accept();
25+
void accept() override;
2626

2727
private Q_SLOTS:
2828
void on_selectFileButton_clicked();

src/qt/optionsdialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ProxyAddressValidator : public QValidator
3030
public:
3131
explicit ProxyAddressValidator(QObject *parent);
3232

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

3636
/** Preferences dialog. */

src/qt/optionsmodel.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ class OptionsModel : public QAbstractListModel
7575
void Init(bool resetSettings = false);
7676
void Reset();
7777

78-
int rowCount(const QModelIndex & parent = QModelIndex()) const;
79-
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
80-
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
78+
int rowCount(const QModelIndex & parent = QModelIndex()) const override;
79+
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
80+
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
8181
/** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */
8282
void setDisplayUnit(const QVariant &value);
8383

src/qt/overviewpage.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class TxViewDelegate : public QAbstractItemDelegate
4040
}
4141

4242
inline void paint(QPainter *painter, const QStyleOptionViewItem &option,
43-
const QModelIndex &index ) const
43+
const QModelIndex &index ) const override
4444
{
4545
painter->save();
4646

@@ -98,7 +98,7 @@ class TxViewDelegate : public QAbstractItemDelegate
9898
painter->restore();
9999
}
100100

101-
inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
101+
inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
102102
{
103103
return QSize(ITEM_HEIGHT, ITEM_HEIGHT);
104104
}

src/qt/paymentserver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private Q_SLOTS:
125125
protected:
126126
// Constructor registers this on the parent QApplication to
127127
// receive QEvent::FileOpen and QEvent:Drop events
128-
bool eventFilter(QObject *object, QEvent *event);
128+
bool eventFilter(QObject *object, QEvent *event) override;
129129

130130
private:
131131
static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request);

src/qt/peertablemodel.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ class PeerTableModel : public QAbstractTableModel
6969

7070
/** @name Methods overridden from QAbstractTableModel
7171
@{*/
72-
int rowCount(const QModelIndex &parent) const;
73-
int columnCount(const QModelIndex &parent) const;
74-
QVariant data(const QModelIndex &index, int role) const;
75-
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
76-
QModelIndex index(int row, int column, const QModelIndex &parent) const;
77-
Qt::ItemFlags flags(const QModelIndex &index) const;
78-
void sort(int column, Qt::SortOrder order);
72+
int rowCount(const QModelIndex &parent) const override;
73+
int columnCount(const QModelIndex &parent) const override;
74+
QVariant data(const QModelIndex &index, int role) const override;
75+
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
76+
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
77+
Qt::ItemFlags flags(const QModelIndex &index) const override;
78+
void sort(int column, Qt::SortOrder order) override;
7979
/*@}*/
8080

8181
public Q_SLOTS:

src/qt/qrdialog.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public Q_SLOTS:
3535
void copyImage();
3636

3737
protected:
38-
virtual void mousePressEvent(QMouseEvent *event);
39-
virtual void contextMenuEvent(QContextMenuEvent *event);
38+
virtual void mousePressEvent(QMouseEvent *event) override;
39+
virtual void contextMenuEvent(QContextMenuEvent *event) override;
4040

4141
private:
4242
QMenu *contextMenu;

src/qt/qvalidatedlineedit.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class QValidatedLineEdit : public QLineEdit
2121
bool isValid();
2222

2323
protected:
24-
void focusInEvent(QFocusEvent *evt);
25-
void focusOutEvent(QFocusEvent *evt);
24+
void focusInEvent(QFocusEvent *evt) override;
25+
void focusOutEvent(QFocusEvent *evt) override;
2626

2727
private:
2828
bool valid;

src/qt/recentrequeststablemodel.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ class RecentRequestsTableModel: public QAbstractTableModel
6363

6464
/** @name Methods overridden from QAbstractTableModel
6565
@{*/
66-
int rowCount(const QModelIndex &parent) const;
67-
int columnCount(const QModelIndex &parent) const;
68-
QVariant data(const QModelIndex &index, int role) const;
69-
bool setData(const QModelIndex &index, const QVariant &value, int role);
70-
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
71-
QModelIndex index(int row, int column, const QModelIndex &parent) const;
72-
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
73-
Qt::ItemFlags flags(const QModelIndex &index) const;
66+
int rowCount(const QModelIndex &parent) const override;
67+
int columnCount(const QModelIndex &parent) const override;
68+
QVariant data(const QModelIndex &index, int role) const override;
69+
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
70+
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
71+
QModelIndex index(int row, int column, const QModelIndex &parent) const override;
72+
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
73+
Qt::ItemFlags flags(const QModelIndex &index) const override;
7474
/*@}*/
7575

7676
const RecentRequestEntry &entry(int row) const { return list[row]; }
@@ -79,7 +79,7 @@ class RecentRequestsTableModel: public QAbstractTableModel
7979
void addNewRequest(RecentRequestEntry &recipient);
8080

8181
public Q_SLOTS:
82-
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
82+
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
8383
void updateDisplayUnit();
8484

8585
private:

0 commit comments

Comments
 (0)