gui: Mark Qt methods as override where appropriate #14267

pull Empact wants to merge 1 commits into bitcoin:master from Empact:qt-rpc-timer-interface-override changing 9 files +46 −39
  1. Empact commented at 7:23 AM on September 19, 2018: member

    As the underlying methods are virtual, and this ensures they'll continue to play that role.

  2. fanquake added the label GUI on Sep 19, 2018
  3. practicalswift commented at 7:26 AM on September 19, 2018: contributor

    utACK f6273597f79bbfcbf907dbf1237bb20a968c8bda @Empact could you look at making this change exhaustive across the codebase? :-)

  4. Empact commented at 7:33 AM on September 19, 2018: member

    I looked at setting up clang-tidy, which detects this condition, but it's more work than I'm up for at the moment.

  5. practicalswift commented at 7:41 AM on September 19, 2018: contributor

    @Empact This output from my scheduled automated runs might be helpful :-)

    clang-tidy with checks google-default-arguments, hicpp-use-override and modernize-use-override enabled:

    src/interfaces/node.cpp:195:14: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/addressbookpage.cpp:39:10: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/addresstablemodel.cpp:396:25: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/bitcoinamountfield.cpp:152:10: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/bitcoinamountfield.cpp:167:17: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/bitcoinamountfield.cpp:35:23: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override]
    src/qt/bitcoinamountfield.cpp:45:10: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/bitcoinamountfield.cpp:67:10: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override]
    src/qt/bitcoinamountfield.cpp:94:11: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/bitcoin.cpp:180:5: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override]
    src/qt/optionsmodel.cpp:206:19: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/optionsmodel.cpp:244:24: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/optionsmodel.cpp:312:20: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/overviewpage.cpp:102:18: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/overviewpage.cpp:37:17: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override]
    src/qt/recentrequeststablemodel.cpp:135:32: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/recentrequeststablemodel.cpp:205:32: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/rpcconsole.cpp:111:5: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/rpcconsole.cpp:120:5: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override]
    src/qt/rpcconsole.cpp:121:17: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/rpcconsole.cpp:122:19: warning: annotate this function with 'override' or (rarely) 'final' [hicpp-use-override]
    src/qt/transactionfilterproxy.cpp:111:29: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    src/qt/transactiontablemodel.cpp:665:36: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
    

    cppcheck:

    [src/rpc/server.h:106] -> [src/qt/rpcconsole.cpp:121]: (style) The function 'Name' overrides a function in a base class but is not marked with a 'override' specifier.
    [src/rpc/server.h:113] -> [src/qt/rpcconsole.cpp:122]: (style) The function 'NewTimer' overrides a function in a base class but is not marked with a 'override' specifier.
    
  6. DrahtBot commented at 9:47 AM on September 19, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:

    • #14214 (convert C-style (void) parameter lists to C++ style () by arvidn)
    • #11625 (Add BitcoinApplication & RPCConsole tests by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. Empact commented at 1:51 PM on September 19, 2018: member

    @practicalswift thanks, will take a look

  8. MarcoFalke commented at 2:14 PM on September 19, 2018: member

    @practicalswift I like your inline-feedback in pull requests and think it is more helpful than the travis linters. (The inline feedback avoids a round-trip to fetch the travis log and can be ignored if needed). I presume it is something you do manually and not yet ready to be run by a bot?

  9. practicalswift commented at 2:17 PM on September 19, 2018: contributor

    @MarcoFalke Thanks for the encouraging words! :-) The jobs run automatically but the tool is not yet ready to post the findings directly without some human review :-)

  10. Mark Qt class methods as override where appropriate
    Primarily identified with clang-tidy here:
    https://github.com/bitcoin/bitcoin/pull/14267#issuecomment-422693176
    345830f83a
  11. Empact force-pushed on Sep 19, 2018
  12. Empact commented at 2:37 PM on September 19, 2018: member

    @practicalswift updated to cover the noted override cases. Did not touch the default args. Confirmed by compilation with the additional specifiers.

  13. Empact renamed this:
    Mark QtRPCTimerInterface methods as override
    Mark Qt methods as override where appropriate
    on Sep 19, 2018
  14. practicalswift commented at 2:52 PM on September 19, 2018: contributor

    utACK 345830f83ad704bbf7edaaf374882039dc60177b

  15. MarcoFalke added the label Refactoring on Sep 19, 2018
  16. MarcoFalke renamed this:
    Mark Qt methods as override where appropriate
    gui: Mark Qt methods as override where appropriate
    on Sep 19, 2018
  17. promag commented at 8:20 PM on September 19, 2018: member

    @MarcoFalke @practicalswift 👍 regarding inline feedback.

    I dislike this change, it's very unlikely Qt changes API, and that would happen if you bump to a major version — which would require lots of testing etc.

    I agree with the override specifier for our virtual methods.

  18. jonasschnelli commented at 9:44 PM on September 20, 2018: contributor

    Agree with @promag.

  19. MarcoFalke commented at 10:02 PM on September 20, 2018: member

    There seems to be disagreement to do this simple change. Probably good to close?

  20. DrahtBot commented at 10:50 PM on September 20, 2018: member

    <!--cf906140f33d8803c4a75a2196329ecb-->Needs rebase

  21. DrahtBot added the label Needs rebase on Sep 20, 2018
  22. Empact closed this on Sep 23, 2018

  23. laanwj removed the label Needs rebase on Oct 24, 2019
  24. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me