Unsolved Semantic isue: ~[className] overrides a destructor but is not marked 'override'
-
Why if I subclass a class like QDialog, QWidget, QMainWindow.... (possible all that came from qWidget)
and if I include in the header file avirtual void accept() override;
or
void mousePressEvent(QMouseEvent *event) override;
or any other override function then is showing that I have also to do the same with the destructor... is that right?? none of the Qt examples shows that...
How is proper to write destructors in Qt????
-
This is a new warning in the current gcc9 (or clang) compiler which is explicitly disabled in Qt code since it's not very useful. But there are are lot of discussions around this, see e.g. here: https://github.com/isocpp/CppCoreGuidelines/issues/721
Qt will not annotate destructors with the override keyword afaik (can't find the discussion on qt-interest atm...)
/edit: found it: https://lists.qt-project.org/pipermail/development/2018-August/033437.html