diff --git a/src/App/AutoTransaction.h b/src/App/AutoTransaction.h index 42a52fb4b1..84476b52f7 100644 --- a/src/App/AutoTransaction.h +++ b/src/App/AutoTransaction.h @@ -24,6 +24,7 @@ #define APP_AUTOTRANSACTION_H #include +#include namespace App { diff --git a/src/Gui/SoFCSelectionAction.h b/src/Gui/SoFCSelectionAction.h index dc50d002f0..4661d3fd54 100644 --- a/src/Gui/SoFCSelectionAction.h +++ b/src/Gui/SoFCSelectionAction.h @@ -123,7 +123,7 @@ class GuiExport SoFCEnableHighlightAction : public SoAction public: SoFCEnableHighlightAction (const SbBool& sel); - ~SoFCEnableHighlightAction(); + ~SoFCEnableHighlightAction() override; SbBool highlight; diff --git a/src/Gui/TreeView.h b/src/Gui/TreeView.h index df977409ef..778968855f 100644 --- a/src/Gui/TreeView.h +++ b/src/Gui/TreeView.h @@ -25,6 +25,7 @@ #define GUI_TREEVIEW_H #include +#include namespace Gui { @@ -34,11 +35,11 @@ class GuiExport TreeView : public QTreeView public: TreeView(QWidget* parent=nullptr); - virtual ~TreeView(); + ~TreeView() override; protected: - void mouseDoubleClickEvent (QMouseEvent * ); - void rowsInserted (const QModelIndex & parent, int start, int end); + void mouseDoubleClickEvent (QMouseEvent * ) override; + void rowsInserted (const QModelIndex & parent, int start, int end) override; }; } diff --git a/src/Gui/ViewProviderPythonFeature.h b/src/Gui/ViewProviderPythonFeature.h index 719434e28e..7c6911386a 100644 --- a/src/Gui/ViewProviderPythonFeature.h +++ b/src/Gui/ViewProviderPythonFeature.h @@ -204,7 +204,7 @@ public: imp = new ViewProviderPythonFeatureImp(this,Proxy); } /// destructor. - virtual ~ViewProviderPythonFeatureT() override { + ~ViewProviderPythonFeatureT() override { delete imp; } diff --git a/src/Mod/Mesh/App/Core/Visitor.h b/src/Mod/Mesh/App/Core/Visitor.h index d57ffb6ac7..61a5d3911b 100644 --- a/src/Mod/Mesh/App/Core/Visitor.h +++ b/src/Mod/Mesh/App/Core/Visitor.h @@ -123,10 +123,10 @@ class MeshExport MeshTopFacetVisitor : public MeshFacetVisitor { public: MeshTopFacetVisitor (std::vector &raulNB) : _raulNeighbours(raulNB) {} - ~MeshTopFacetVisitor () override {} + ~MeshTopFacetVisitor () override = default; /** Collects the facet indices. */ - virtual bool Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom, - FacetIndex ulFInd, unsigned long) override + bool Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom, + FacetIndex ulFInd, unsigned long) override { (void)rclFacet; (void)rclFrom; diff --git a/src/Mod/Path/Gui/TaskDlgPathCompound.h b/src/Mod/Path/Gui/TaskDlgPathCompound.h index f3a19d5f75..4ced6cca33 100644 --- a/src/Mod/Path/Gui/TaskDlgPathCompound.h +++ b/src/Mod/Path/Gui/TaskDlgPathCompound.h @@ -75,7 +75,7 @@ public: void helpRequested() override; /// returns for Close and Help button - virtual QDialogButtonBox::StandardButtons getStandardButtons() const override + QDialogButtonBox::StandardButtons getStandardButtons() const override { return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; } protected: diff --git a/src/Mod/Path/Gui/ViewProviderPath.h b/src/Mod/Path/Gui/ViewProviderPath.h index 8e3c8a01eb..8d9f3864ec 100644 --- a/src/Mod/Path/Gui/ViewProviderPath.h +++ b/src/Mod/Path/Gui/ViewProviderPath.h @@ -73,7 +73,7 @@ public: std::vector getDisplayModes() const override; void updateData(const App::Property*) override; void recomputeBoundingBox(); - virtual QIcon getIcon() const override; + QIcon getIcon() const override; bool useNewSelectionModel() const override; std::string getElement(const SoDetail *) const override; diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h index c23be79a44..dd5b9875fe 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerTrimming.h @@ -71,7 +71,7 @@ class DrawSketchHandlerTrimming: public DrawSketchHandler { public: DrawSketchHandlerTrimming() = default; - virtual ~DrawSketchHandlerTrimming() + ~DrawSketchHandlerTrimming() override { Gui::Selection().rmvSelectionGate(); } diff --git a/src/Mod/TechDraw/App/PropertyCosmeticEdgeList.h b/src/Mod/TechDraw/App/PropertyCosmeticEdgeList.h index 3c2dbcf647..63f7c7849f 100644 --- a/src/Mod/TechDraw/App/PropertyCosmeticEdgeList.h +++ b/src/Mod/TechDraw/App/PropertyCosmeticEdgeList.h @@ -52,7 +52,7 @@ public: * A destructor. * A more elaborate description of the destructor. */ - virtual ~PropertyCosmeticEdgeList() override; + ~PropertyCosmeticEdgeList() override; void setSize(int newSize) override; int getSize(void) const override; diff --git a/src/Mod/TechDraw/Gui/TaskDimRepair.h b/src/Mod/TechDraw/Gui/TaskDimRepair.h index dbed5ceb88..1bc41b83f5 100644 --- a/src/Mod/TechDraw/Gui/TaskDimRepair.h +++ b/src/Mod/TechDraw/Gui/TaskDimRepair.h @@ -48,7 +48,7 @@ class TaskDimRepair: public QWidget public: TaskDimRepair(TechDraw::DrawViewDimension* inDvd); - ~TaskDimRepair(); + ~TaskDimRepair() override; public: virtual bool accept(); @@ -58,7 +58,7 @@ protected Q_SLOTS: void slotUseSelection(); protected: - void changeEvent(QEvent* e); + void changeEvent(QEvent* e) override; void setUiPrimary(); void replaceReferences(); diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index 7c39527bd7..b2d4b615ed 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -57,7 +57,7 @@ namespace @self.export.Namespace.replace("::"," { namespace ")@ class @self.export.Namespace.replace("::","_")@Export @self.export.Name@ : public @self.export.FatherNamespace@::@self.export.Father@ { protected: - ~@self.export.Name@(); + ~@self.export.Name@() override; public: static PyTypeObject Type; @@ -79,12 +79,12 @@ public: static int descriptorSetter(PyObject* self, PyObject* obj, PyObject* value); - static PyGetSetDef GetterSetter[]; - virtual PyTypeObject *GetType() {return &Type;} + PyTypeObject *GetType() override {return &Type;} public: @self.export.Name@(@self.export.TwinPointer@ *pcObject, PyTypeObject *T = &Type); static PyObject *PyMake(struct _typeobject *, PyObject *, PyObject *); - virtual int PyInit(PyObject* args, PyObject*k); + int PyInit(PyObject* args, PyObject*k) override; + if (self.export.Initialization): int initialization(); @@ -93,7 +93,7 @@ public: using PointerType = @self.export.TwinPointer@*; - virtual PyObject *_repr(); // the representation + PyObject *_repr() override; // the representation std::string representation() const; /** @name callbacks and implementers for the python object methods */ @@ -232,8 +232,8 @@ public: /// setter for special attributes (e.g. dynamic ones) /// Output: Success=1, Failure=-1, Ignore=0 int setCustomAttributes(const char* attr, PyObject *obj); - PyObject *_getattr(const char *attr); // __getattr__ function - int _setattr(const char *attr, PyObject *value); // __setattr__ function + PyObject *_getattr(const char *attr) override; // __getattr__ function + int _setattr(const char *attr, PyObject *value) override; // __setattr__ function - /// getter for the object handled by this class diff --git a/tests/src/Qt/InventorBuilder.cpp b/tests/src/Qt/InventorBuilder.cpp index c3f63ac6fc..cede8eebfa 100644 --- a/tests/src/Qt/InventorBuilder.cpp +++ b/tests/src/Qt/InventorBuilder.cpp @@ -23,8 +23,7 @@ public: testInventorBuilder() : builder(output) {} - ~testInventorBuilder() - {} + ~testInventorBuilder() override = default; SoNode* loadBuffer(const std::string& buffer) {