diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-05-11 13:34:01 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-05-11 13:34:07 -0400 |
commit | eb2ffbb7c1347115e6a3d6fa30f909959b6170a5 (patch) | |
tree | 468939ea19cdfe96d4b82d42cc09a4b647861103 /src/qt/bitcoingui.h | |
parent | f71a3a8829746cb17fc42c7475cf03229ad6c08e (diff) | |
parent | d044e0ec7d37bbcdf10bbdb903b9119741c7297d (diff) |
Merge #18914: refactor: Apply override specifier consistently
d044e0ec7d37bbcdf10bbdb903b9119741c7297d refactor: Remove override for final overriders (Hennadii Stepanov)
1551cea2d52cac403ff506a7cc955d8de8fd6f3e refactor: Use override for non-final overriders (Hennadii Stepanov)
Pull request description:
Two commits are split out from #16710 to make reviewing [easier](https://github.com/bitcoin/bitcoin/pull/16710#issuecomment-625760894).
From [C++ FAQ](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final):
> C.128: Virtual functions should specify exactly one of virtual, override, or final
> **Reason** Readability. Detection of mistakes. Writing explicit `virtual`, `override`, or `final` is self-documenting and enables the compiler to catch mismatch of types and/or names between base and derived classes. However, writing more than one of these three is both redundant and a potential source of errors.
ACKs for top commit:
practicalswift:
ACK d044e0ec7d37bbcdf10bbdb903b9119741c7297d: consistent use of `override` prevents bugs + patch looks correct + Travis happy
MarcoFalke:
ACK d044e0ec7d37bbcdf10bbdb903b9119741c7297d, based on my understanding that adding `override` or `final` to a function must always be correct, unless it doesn't compile!?
vasild:
ACK d044e0ec7
Tree-SHA512: 245fd9b99b8b5cbf8694061f892cb3435f3378c97ebed9f9401ce86d21890211f2234bcc39c9f0f79a4d2806cb31bf8ce41a0f9c2acef4f3a2ac5beca6b077cf
Diffstat (limited to 'src/qt/bitcoingui.h')
-rw-r--r-- | src/qt/bitcoingui.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index dda88930db..6733585f68 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -99,12 +99,12 @@ public: void unsubscribeFromCoreSignals(); protected: - void changeEvent(QEvent *e); - void closeEvent(QCloseEvent *event); - void showEvent(QShowEvent *event); - void dragEnterEvent(QDragEnterEvent *event); - void dropEvent(QDropEvent *event); - bool eventFilter(QObject *object, QEvent *event); + void changeEvent(QEvent *e) override; + void closeEvent(QCloseEvent *event) override; + void showEvent(QShowEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; + void dropEvent(QDropEvent *event) override; + bool eventFilter(QObject *object, QEvent *event) override; private: interfaces::Node& m_node; @@ -325,7 +325,7 @@ public: protected: /** So that it responds to left-button clicks */ - void mousePressEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event) override; private: OptionsModel *optionsModel; |