[vlc-devel] [PATCH 0/2][RFC] qt4: Use Q_DECL_OVERRIDE on overridden functions

Uwe L. Korn uwelk at xhochy.com
Tue Aug 12 16:53:46 CEST 2014


Using virtual repeated on functions in subclasses of the original virtual
declaration of a function is redundant. Although a nice variant to document that
we are overriding a virtual function, it has no effect on error detection within
the compilation process. C++11 offers the `override` keyword for doing exactly
this. Although I'm probably one of very few people compiling VLC with C++11,
with Q_DECL_OVERRIDE Qt(5) provides a macro so that it is visible that we
override a virtual function and do the checks if the compiler supports it.

If appreciated, I would look through all virtual functions in the qt4 plugin
and replace the relevant occasions of virtual with Q_DECL_OVERRIDE. Just  +1
if you think this is good and I should invest more time in it.

Uwe L. Korn (2):
  qt4: Define Q_DECL_OVERRIDE for Qt4
  qt4: Replace redundant virtual with Q_DECL_OVERRIDE

 modules/gui/qt4/main_interface.hpp | 18 +++++++++---------
 modules/gui/qt4/qt4.hpp            |  5 +++++
 modules/gui/qt4/util/qvlcframe.hpp |  4 ++--
 3 files changed, 16 insertions(+), 11 deletions(-)

-- 
2.0.4




More information about the vlc-devel mailing list