From e72da4d4c47396897d2aad5ee97667c9fd0773de Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 3 Aug 2023 23:12:19 +0200 Subject: [PATCH] Gui: modernize C++: use override --- src/Gui/AutoSaver.cpp | 4 +- src/Gui/Clipping.h | 4 +- src/Gui/CommandCompleter.cpp | 10 ++--- src/Gui/CommandCompleter.h | 2 +- src/Gui/DlgAddProperty.h | 6 ++- src/Gui/DlgCheckableMessageBox.h | 6 +-- src/Gui/DlgInputDialogImp.h | 3 +- src/Gui/DlgPreferencePackManagementImp.h | 3 +- src/Gui/Inventor/SmSwitchboard.h | 19 ++++----- src/Gui/Inventor/SoAutoZoomTranslation.h | 17 ++++---- src/Gui/Inventor/SoDrawingGrid.h | 15 +++---- src/Gui/Language/Translator.h | 4 +- src/Gui/MainWindow.cpp | 2 +- src/Gui/NotificationArea.cpp | 2 +- src/Gui/NotificationArea.h | 4 +- src/Gui/PythonDebugger.h | 18 +++++---- src/Gui/PythonEditor.h | 4 +- src/Gui/PythonWrapper.cpp | 2 +- src/Gui/QSint/actionpanel/actionlabel.h | 2 +- src/Gui/ShortcutManager.h | 2 +- src/Gui/SoAxisCrossKit.h | 23 ++++++----- src/Gui/SoFCBackgroundGradient.h | 4 +- src/Gui/SoFCBoundingBox.h | 13 +++--- src/Gui/SoFCCSysDragger.h | 9 +++-- src/Gui/SoFCInteractiveElement.h | 47 +++++++++++----------- src/Gui/SoFCSelectionAction.h | 51 ++++++++++++------------ src/Gui/SoFCVectorizeSVGAction.h | 27 +++++++------ src/Gui/SoFCVectorizeU3DAction.h | 22 +++++----- src/Gui/SoMouseWheelEvent.h | 3 +- src/Gui/SyntaxHighlighter.h | 2 +- src/Gui/TaskView/TaskImage.h | 4 +- src/Gui/ToolBox.h | 7 +++- src/Gui/TreeParams.cpp | 4 +- src/Gui/ViewProviderExtensionPython.h | 7 ++-- src/Gui/ViewProviderPythonFeature.h | 2 +- 35 files changed, 186 insertions(+), 168 deletions(-) diff --git a/src/Gui/AutoSaver.cpp b/src/Gui/AutoSaver.cpp index 6da991376d..78b6f795b9 100644 --- a/src/Gui/AutoSaver.cpp +++ b/src/Gui/AutoSaver.cpp @@ -333,11 +333,11 @@ public: tmpName = QString::fromLatin1("%1.tmp%2").arg(fileName).arg(rand()); writer.putNextEntry(tmpName.toUtf8().constData()); } - virtual ~RecoveryRunnable() + ~RecoveryRunnable() override { delete prop; } - virtual void run() + void run() override { prop->SaveDocFile(writer); writer.close(); diff --git a/src/Gui/Clipping.h b/src/Gui/Clipping.h index 7737be1f16..6b5b0653be 100644 --- a/src/Gui/Clipping.h +++ b/src/Gui/Clipping.h @@ -41,7 +41,7 @@ class GuiExport Clipping : public QDialog public: static Clipping* makeDockWidget(Gui::View3DInventor*); Clipping(Gui::View3DInventor* view, QWidget* parent = nullptr); - ~Clipping(); + ~Clipping() override; protected: void setupConnections(); @@ -63,7 +63,7 @@ protected: void onDirZValueChanged(double); public: - void reject(); + void reject() override; private: class Private; diff --git a/src/Gui/CommandCompleter.cpp b/src/Gui/CommandCompleter.cpp index ede6c11fe4..609fd3fef2 100644 --- a/src/Gui/CommandCompleter.cpp +++ b/src/Gui/CommandCompleter.cpp @@ -85,12 +85,12 @@ public: endResetModel(); } - virtual QModelIndex parent(const QModelIndex &) const + QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); } - virtual QVariant data(const QModelIndex & index, int role) const + QVariant data(const QModelIndex & index, int role) const override { if (index.row() < 0 || index.row() >= (int)_Commands.size()) return QVariant(); @@ -128,17 +128,17 @@ public: return QVariant(); } - virtual QModelIndex index(int row, int, const QModelIndex &) const + QModelIndex index(int row, int, const QModelIndex &) const override { return this->createIndex(row, 0); } - virtual int rowCount(const QModelIndex &) const + int rowCount(const QModelIndex &) const override { return (int)(_Commands.size()); } - virtual int columnCount(const QModelIndex &) const + int columnCount(const QModelIndex &) const override { return 1; } diff --git a/src/Gui/CommandCompleter.h b/src/Gui/CommandCompleter.h index 1f578e1909..0537055032 100644 --- a/src/Gui/CommandCompleter.h +++ b/src/Gui/CommandCompleter.h @@ -52,7 +52,7 @@ protected Q_SLOTS: void onCommandActivated(const QModelIndex &); protected: - bool eventFilter(QObject *, QEvent *ev); + bool eventFilter(QObject *, QEvent *ev) override; }; } // namespace Gui diff --git a/src/Gui/DlgAddProperty.h b/src/Gui/DlgAddProperty.h index 13d2300b24..4a26faa6c1 100644 --- a/src/Gui/DlgAddProperty.h +++ b/src/Gui/DlgAddProperty.h @@ -24,6 +24,8 @@ #define GUI_DIALOG_DLGADDPROPERTY_H #include +#include +#include namespace App { class PropertyContainer; @@ -39,9 +41,9 @@ class GuiExport DlgAddProperty : public QDialog public: DlgAddProperty(QWidget *parent, std::unordered_set &&); - ~DlgAddProperty(); + ~DlgAddProperty() override; - virtual void accept() override; + void accept() override; private: std::unordered_set containers; diff --git a/src/Gui/DlgCheckableMessageBox.h b/src/Gui/DlgCheckableMessageBox.h index f20978eccc..da268fb99a 100644 --- a/src/Gui/DlgCheckableMessageBox.h +++ b/src/Gui/DlgCheckableMessageBox.h @@ -56,7 +56,7 @@ class GuiExport DlgCheckableMessageBox : public QDialog Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton) // clazy:exclude=qproperty-without-notify public: explicit DlgCheckableMessageBox(QWidget *parent); - virtual ~DlgCheckableMessageBox(); + ~DlgCheckableMessageBox() override; static QDialogButtonBox::StandardButton question(QWidget *parent, @@ -74,8 +74,8 @@ public: void setPrefPath(const QString& path); - virtual void accept(); - virtual void reject(); + void accept() override; + void reject() override; bool isChecked() const; void setChecked(bool s); diff --git a/src/Gui/DlgInputDialogImp.h b/src/Gui/DlgInputDialogImp.h index d658f3c03f..f79d6f04ee 100644 --- a/src/Gui/DlgInputDialogImp.h +++ b/src/Gui/DlgInputDialogImp.h @@ -26,6 +26,7 @@ #include #include +#include class QSpinBox; class QDoubleSpinBox; @@ -53,7 +54,7 @@ public: enum Type { LineEdit, SpinBox, UIntBox, FloatSpinBox, ComboBox }; DlgInputDialogImp( const QString& label, QWidget* parent = nullptr, bool modal = true, Type = LineEdit ); - ~DlgInputDialogImp(); + ~DlgInputDialogImp() override; void setType( Type t ); Type type() const; diff --git a/src/Gui/DlgPreferencePackManagementImp.h b/src/Gui/DlgPreferencePackManagementImp.h index 0e3ab1ea9a..079d4a3be4 100644 --- a/src/Gui/DlgPreferencePackManagementImp.h +++ b/src/Gui/DlgPreferencePackManagementImp.h @@ -27,6 +27,7 @@ #include #include #include +#include class QTreeWidgetItem; @@ -51,7 +52,7 @@ class GuiExport DlgPreferencePackManagementImp : public QDialog public: DlgPreferencePackManagementImp(QWidget* parent = nullptr); - ~DlgPreferencePackManagementImp(); + ~DlgPreferencePackManagementImp() override; Q_SIGNALS: void packVisibilityChanged(); diff --git a/src/Gui/Inventor/SmSwitchboard.h b/src/Gui/Inventor/SmSwitchboard.h index b4eb17bbab..0a34681e48 100644 --- a/src/Gui/Inventor/SmSwitchboard.h +++ b/src/Gui/Inventor/SmSwitchboard.h @@ -35,6 +35,7 @@ #include #include +#include class GuiExport SmSwitchboard : public SoGroup { @@ -48,17 +49,17 @@ public: SoMFBool enable; - virtual void doAction(SoAction * action); - virtual void callback(SoCallbackAction * action); - virtual void GLRender(SoGLRenderAction * action); - virtual void pick(SoPickAction * action); - virtual void getBoundingBox(SoGetBoundingBoxAction * action); - virtual void handleEvent(SoHandleEventAction * action); - virtual void getMatrix(SoGetMatrixAction * action); - virtual void search(SoSearchAction * action); + void doAction(SoAction * action) override; + void callback(SoCallbackAction * action) override; + void GLRender(SoGLRenderAction * action) override; + void pick(SoPickAction * action) override; + void getBoundingBox(SoGetBoundingBoxAction * action) override; + void handleEvent(SoHandleEventAction * action) override; + void getMatrix(SoGetMatrixAction * action) override; + void search(SoSearchAction * action) override; protected: - virtual ~SmSwitchboard(); + ~SmSwitchboard() override; }; diff --git a/src/Gui/Inventor/SoAutoZoomTranslation.h b/src/Gui/Inventor/SoAutoZoomTranslation.h index 28ffaacd58..1bd5c290de 100644 --- a/src/Gui/Inventor/SoAutoZoomTranslation.h +++ b/src/Gui/Inventor/SoAutoZoomTranslation.h @@ -25,6 +25,7 @@ #include #include +#include namespace Gui { @@ -41,14 +42,14 @@ public: SoSFFloat scaleFactor; protected: - virtual ~SoAutoZoomTranslation() {} - virtual void doAction(SoAction * action); - virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action); - virtual void getMatrix(SoGetMatrixAction * action); - virtual void GLRender(SoGLRenderAction *action); - virtual void getBoundingBox(SoGetBoundingBoxAction * action); - virtual void callback(SoCallbackAction * action); - virtual void pick(SoPickAction * action); + ~SoAutoZoomTranslation() override {} + void doAction(SoAction * action) override; + void getPrimitiveCount(SoGetPrimitiveCountAction * action) override; + void getMatrix(SoGetMatrixAction * action) override; + void GLRender(SoGLRenderAction *action) override; + void getBoundingBox(SoGetBoundingBoxAction * action) override; + void callback(SoCallbackAction * action) override; + void pick(SoPickAction * action) override; float getScaleFactor(SoAction*) const; private: diff --git a/src/Gui/Inventor/SoDrawingGrid.h b/src/Gui/Inventor/SoDrawingGrid.h index af5d9ce2f4..8b625cea19 100644 --- a/src/Gui/Inventor/SoDrawingGrid.h +++ b/src/Gui/Inventor/SoDrawingGrid.h @@ -24,6 +24,7 @@ #define GUI_INVENTOR_SODRAWINGGRID_H #include +#include namespace Gui { namespace Inventor { @@ -37,17 +38,17 @@ public: SoDrawingGrid(); public: - virtual void GLRender(SoGLRenderAction *action); - virtual void GLRenderBelowPath(SoGLRenderAction *action); - virtual void GLRenderInPath(SoGLRenderAction *action); - virtual void GLRenderOffPath(SoGLRenderAction *action); - virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er); - virtual void generatePrimitives(SoAction *action); + void GLRender(SoGLRenderAction *action) override; + void GLRenderBelowPath(SoGLRenderAction *action) override; + void GLRenderInPath(SoGLRenderAction *action) override; + void GLRenderOffPath(SoGLRenderAction *action) override; + void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; + void generatePrimitives(SoAction *action) override; private: void renderGrid(SoGLRenderAction *action); // Force using the reference count mechanism. - virtual ~SoDrawingGrid() {} + ~SoDrawingGrid() override {} }; } // namespace Inventor diff --git a/src/Gui/Language/Translator.h b/src/Gui/Language/Translator.h index 92f84ff87d..23d8e10573 100644 --- a/src/Gui/Language/Translator.h +++ b/src/Gui/Language/Translator.h @@ -77,7 +77,7 @@ public: /** Adds a path where localization files can be found */ void addPath(const QString& path); /** eventFilter used to convert decimal separator **/ - bool eventFilter(QObject* obj, QEvent* ev); + bool eventFilter(QObject* obj, QEvent* ev) override; /** Enables/disables decimal separator conversion **/ void enableDecimalPointConversion(bool on); /** Returns whether decimal separator conversion is enabled */ @@ -85,7 +85,7 @@ public: private: Translator(); - ~Translator(); + ~Translator() override; void removeTranslators(); QStringList directories() const; void installQMFiles(const QDir& dir, const char* locale); diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index dc6ed50725..ae05af157f 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -190,7 +190,7 @@ public: getWindowParameter()->Attach(this); } - ~DimensionWidget() + ~DimensionWidget() override { getWindowParameter()->Detach(this); } diff --git a/src/Gui/NotificationArea.cpp b/src/Gui/NotificationArea.cpp index e8ae746140..a3206b0fa7 100644 --- a/src/Gui/NotificationArea.cpp +++ b/src/Gui/NotificationArea.cpp @@ -380,7 +380,7 @@ public: : QWidgetAction(parent) {} - ~NotificationsAction() + ~NotificationsAction() override { for (auto* item : pushedItems) { if (item) { diff --git a/src/Gui/NotificationArea.h b/src/Gui/NotificationArea.h index 9e5622b9bb..9a60ac74e3 100644 --- a/src/Gui/NotificationArea.h +++ b/src/Gui/NotificationArea.h @@ -50,7 +50,7 @@ public: { public: explicit ParameterObserver(NotificationArea* notificationarea); - ~ParameterObserver(); + ~ParameterObserver() override; void OnChange(Base::Subject& rCaller, const char* sReason) override; @@ -61,7 +61,7 @@ public: }; NotificationArea(QWidget* parent = nullptr); - ~NotificationArea(); + ~NotificationArea() override; void pushNotification(const QString& notifiername, const QString& message, Base::LogStyle level); diff --git a/src/Gui/PythonDebugger.h b/src/Gui/PythonDebugger.h index 489c992b15..ec9df7370f 100644 --- a/src/Gui/PythonDebugger.h +++ b/src/Gui/PythonDebugger.h @@ -26,6 +26,8 @@ #include #include #include +#include +#include namespace Gui { @@ -98,7 +100,7 @@ public: static void init_module(); PythonDebugModule(); - virtual ~PythonDebugModule(); + ~PythonDebugModule() override; private: Py::Object getFunctionCallCount(const Py::Tuple &a); @@ -116,9 +118,9 @@ public: static void init_type(); // announce properties and methods PythonDebugStdout(); - ~PythonDebugStdout(); + ~PythonDebugStdout() override; - Py::Object repr(); + Py::Object repr() override; Py::Object write(const Py::Tuple&); Py::Object flush(const Py::Tuple&); }; @@ -132,9 +134,9 @@ public: static void init_type(); // announce properties and methods PythonDebugStderr(); - ~PythonDebugStderr(); + ~PythonDebugStderr() override; - Py::Object repr(); + Py::Object repr() override; Py::Object write(const Py::Tuple&); }; @@ -147,9 +149,9 @@ public: static void init_type(); // announce properties and methods PythonDebugExcept(); - ~PythonDebugExcept(); + ~PythonDebugExcept() override; - Py::Object repr(); + Py::Object repr() override; Py::Object excepthook(const Py::Tuple&); }; @@ -159,7 +161,7 @@ class GuiExport PythonDebugger : public QObject public: PythonDebugger(); - ~PythonDebugger(); + ~PythonDebugger() override; Breakpoint getBreakpoint(const QString&) const; bool toggleBreakpoint(int line, const QString&); void runFile(const QString& fn); diff --git a/src/Gui/PythonEditor.h b/src/Gui/PythonEditor.h index 7ddc5aa628..c291fe8a49 100644 --- a/src/Gui/PythonEditor.h +++ b/src/Gui/PythonEditor.h @@ -80,9 +80,9 @@ class GuiExport PythonSyntaxHighlighter : public SyntaxHighlighter { public: explicit PythonSyntaxHighlighter(QObject* parent); - virtual ~PythonSyntaxHighlighter(); + ~PythonSyntaxHighlighter() override; - void highlightBlock (const QString & text); + void highlightBlock (const QString & text) override; private: PythonSyntaxHighlighterP* d; diff --git a/src/Gui/PythonWrapper.cpp b/src/Gui/PythonWrapper.cpp index 702b18c0a8..c460d17bf9 100644 --- a/src/Gui/PythonWrapper.cpp +++ b/src/Gui/PythonWrapper.cpp @@ -352,7 +352,7 @@ private: this, &WrapperManager::clear); wrapQApplication(); } - ~WrapperManager() = default; + ~WrapperManager() override = default; }; template diff --git a/src/Gui/QSint/actionpanel/actionlabel.h b/src/Gui/QSint/actionpanel/actionlabel.h index 127738180c..988906de7f 100644 --- a/src/Gui/QSint/actionpanel/actionlabel.h +++ b/src/Gui/QSint/actionpanel/actionlabel.h @@ -79,7 +79,7 @@ public: */ explicit ActionLabel(QAction *action, QWidget *parent = nullptr); - virtual ~ActionLabel() {} + ~ActionLabel() override {} QSize sizeHint() const override; QSize minimumSizeHint() const override; diff --git a/src/Gui/ShortcutManager.h b/src/Gui/ShortcutManager.h index 2af637b6ea..e18582134a 100644 --- a/src/Gui/ShortcutManager.h +++ b/src/Gui/ShortcutManager.h @@ -48,7 +48,7 @@ class GuiExport ShortcutManager : public QObject, public ParameterGrp::ObserverT public: ShortcutManager(); - ~ShortcutManager(); + ~ShortcutManager() override; static ShortcutManager *instance(); static void destroy(); diff --git a/src/Gui/SoAxisCrossKit.h b/src/Gui/SoAxisCrossKit.h index d8c9b5c62b..922e35d13b 100644 --- a/src/Gui/SoAxisCrossKit.h +++ b/src/Gui/SoAxisCrossKit.h @@ -29,6 +29,7 @@ #include #include #include +#include class SbViewport; @@ -54,8 +55,8 @@ public: SoSFFloat scaleFactor; protected: - virtual void GLRender(SoGLRenderAction * action); - virtual ~SoShapeScale(); + void GLRender(SoGLRenderAction * action) override; + ~SoShapeScale() override; }; class GuiExport SoAxisCrossKit : public SoBaseKit { @@ -75,16 +76,16 @@ public: // Overrides default method. All the parts are shapeKits, // so this node will not affect the state. - virtual SbBool affectsState() const; - virtual void addWriteReference(SoOutput * out, SbBool isfromfield = false); - virtual void getBoundingBox(SoGetBoundingBoxAction * action); + SbBool affectsState() const override; + void addWriteReference(SoOutput * out, SbBool isfromfield = false) override; + void getBoundingBox(SoGetBoundingBoxAction * action) override; static void initClass(); private: // Constructor calls to build and set up parts. void createAxes(); - virtual ~SoAxisCrossKit(); + ~SoAxisCrossKit() override; }; class GuiExport SoRegPoint : public SoShape { @@ -96,7 +97,7 @@ public: static void initClass(); SoRegPoint(); - void notify(SoNotList * node); + void notify(SoNotList * node) override; SoSFVec3f base; SoSFVec3f normal; @@ -105,10 +106,10 @@ public: SoSFString text; protected: - virtual ~SoRegPoint(); - virtual void GLRender(SoGLRenderAction *action); - virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er); - virtual void generatePrimitives(SoAction *action); + ~SoRegPoint() override; + void GLRender(SoGLRenderAction *action) override; + void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; + void generatePrimitives(SoAction *action) override; private: SoSeparator* root; diff --git a/src/Gui/SoFCBackgroundGradient.h b/src/Gui/SoFCBackgroundGradient.h index 1398248a0b..2648111429 100644 --- a/src/Gui/SoFCBackgroundGradient.h +++ b/src/Gui/SoFCBackgroundGradient.h @@ -48,7 +48,7 @@ public: static void finish(); SoFCBackgroundGradient(); - void GLRender (SoGLRenderAction *action); + void GLRender (SoGLRenderAction *action) override; void setGradient(Gradient grad); Gradient getGradient() const; void setColorGradient(const SbColor& fromColor, @@ -61,7 +61,7 @@ private: Gradient gradient; protected: - virtual ~SoFCBackgroundGradient(); + ~SoFCBackgroundGradient() override; SbColor fCol, tCol, mCol; }; diff --git a/src/Gui/SoFCBoundingBox.h b/src/Gui/SoFCBoundingBox.h index 26667bb3b0..b394d4942a 100644 --- a/src/Gui/SoFCBoundingBox.h +++ b/src/Gui/SoFCBoundingBox.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace Gui { @@ -62,10 +63,10 @@ public: protected: - virtual ~SoFCBoundingBox(); - virtual void GLRender(SoGLRenderAction *action); - virtual void generatePrimitives (SoAction *action); - virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er); + ~SoFCBoundingBox() override; + void GLRender(SoGLRenderAction *action) override; + void generatePrimitives (SoAction *action) override; + void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er) override; private: SoSeparator *root, *textSep, *dimSep; @@ -93,10 +94,10 @@ public: SoSFEnum mode; - virtual void getBoundingBox(SoGetBoundingBoxAction *action); + void getBoundingBox(SoGetBoundingBoxAction *action) override; protected: - virtual ~SoSkipBoundingGroup(); + ~SoSkipBoundingGroup() override; }; } // namespace Gui diff --git a/src/Gui/SoFCCSysDragger.h b/src/Gui/SoFCCSysDragger.h index a0ac0f5934..91aa418d68 100644 --- a/src/Gui/SoFCCSysDragger.h +++ b/src/Gui/SoFCCSysDragger.h @@ -33,6 +33,7 @@ #include #include #include +#include class SoCamera; @@ -181,7 +182,7 @@ class GuiExport SoFCCSysDragger : public SoDragger public: static void initClass(); SoFCCSysDragger(); - ~SoFCCSysDragger(); + ~SoFCCSysDragger() override; SoSFVec3f translation; //!< initial translation and reflects single precision movement. SoSFDouble translationIncrement; //!< set from outside used for rounding. @@ -240,11 +241,11 @@ public: bool isHiddenRotationZ(); //!< is x rotation dragger hidden. //@} - virtual void GLRender(SoGLRenderAction * action) override; + void GLRender(SoGLRenderAction * action) override; protected: - virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE) override; - virtual void handleEvent(SoHandleEventAction * action) override; + SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE) override; + void handleEvent(SoHandleEventAction * action) override; static void translationSensorCB(void *f, SoSensor *); static void rotationSensorCB(void *f, SoSensor *); diff --git a/src/Gui/SoFCInteractiveElement.h b/src/Gui/SoFCInteractiveElement.h index c95016c60e..d8ad66def7 100644 --- a/src/Gui/SoFCInteractiveElement.h +++ b/src/Gui/SoFCInteractiveElement.h @@ -30,6 +30,7 @@ #include #include +#include namespace Gui { @@ -44,13 +45,13 @@ class GuiExport SoFCInteractiveElement : public SoReplacedElement { public: static void initClass(); - virtual void init(SoState * state); + void init(SoState * state) override; static void set(SoState * const state, SoNode * const node, SbBool mode); static SbBool get(SoState * const state); static const SoFCInteractiveElement * getInstance(SoState * state); protected: - virtual ~SoFCInteractiveElement(); + ~SoFCInteractiveElement() override; virtual void setElt(SbBool mode); private: @@ -65,18 +66,18 @@ class GuiExport SoGLWidgetElement : public SoElement { public: static void initClass(); - virtual void init(SoState * state); - virtual void push(SoState * state); - virtual void pop(SoState * state, const SoElement * prevTopElement); + void init(SoState * state) override; + void push(SoState * state) override; + void pop(SoState * state, const SoElement * prevTopElement) override; - virtual SbBool matches(const SoElement * element) const; - virtual SoElement * copyMatchInfo() const; + SbBool matches(const SoElement * element) const override; + SoElement * copyMatchInfo() const override; static void set(SoState * state, QtGLWidget * window); static void get(SoState * state, QtGLWidget *& window); protected: - virtual ~SoGLWidgetElement(); + ~SoGLWidgetElement() override; protected: QtGLWidget * window; @@ -90,18 +91,18 @@ class GuiExport SoGLRenderActionElement : public SoElement { public: static void initClass(); - virtual void init(SoState * state); - virtual void push(SoState * state); - virtual void pop(SoState * state, const SoElement * prevTopElement); + void init(SoState * state) override; + void push(SoState * state) override; + void pop(SoState * state, const SoElement * prevTopElement) override; - virtual SbBool matches(const SoElement * element) const; - virtual SoElement * copyMatchInfo() const; + SbBool matches(const SoElement * element) const override; + SoElement * copyMatchInfo() const override; static void set(SoState * state, SoGLRenderAction * action); static void get(SoState * state, SoGLRenderAction * & action); protected: - virtual ~SoGLRenderActionElement(); + ~SoGLRenderActionElement() override; protected: SoGLRenderAction * glRenderAction; @@ -118,11 +119,11 @@ public: QtGLWidget * window; - virtual void doAction(SoAction * action); - virtual void GLRender(SoGLRenderAction * action); + void doAction(SoAction * action) override; + void GLRender(SoGLRenderAction * action) override; protected: - virtual ~SoGLWidgetNode(); + ~SoGLWidgetNode() override; }; class GuiExport SoGLVBOActivatedElement : public SoElement { @@ -133,18 +134,18 @@ class GuiExport SoGLVBOActivatedElement : public SoElement { public: static void initClass(); - virtual void init(SoState * state); - virtual void push(SoState * state); - virtual void pop(SoState * state, const SoElement * prevTopElement); + void init(SoState * state) override; + void push(SoState * state) override; + void pop(SoState * state, const SoElement * prevTopElement) override; - virtual SbBool matches(const SoElement * element) const; - virtual SoElement * copyMatchInfo() const; + SbBool matches(const SoElement * element) const override; + SoElement * copyMatchInfo() const override; static void set(SoState * state, SbBool); static void get(SoState * state, SbBool& active); protected: - virtual ~SoGLVBOActivatedElement(); + ~SoGLVBOActivatedElement() override; protected: SbBool active; diff --git a/src/Gui/SoFCSelectionAction.h b/src/Gui/SoFCSelectionAction.h index 325a23507e..dc50d002f0 100644 --- a/src/Gui/SoFCSelectionAction.h +++ b/src/Gui/SoFCSelectionAction.h @@ -28,6 +28,7 @@ #include #include #include +#include class SoSFString; class SoSFColor; @@ -47,7 +48,7 @@ class GuiExport SoFCHighlightAction : public SoAction public: SoFCHighlightAction (const SelectionChanges &SelCh); - ~SoFCHighlightAction(); + ~SoFCHighlightAction() override; static void initClass(); static void finish(); @@ -55,7 +56,7 @@ public: const SelectionChanges &SelChange; protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -72,7 +73,7 @@ class GuiExport SoFCSelectionAction : public SoAction public: SoFCSelectionAction (const SelectionChanges &SelCh); - ~SoFCSelectionAction(); + ~SoFCSelectionAction() override; static void initClass(); static void finish(); @@ -80,7 +81,7 @@ public: const SelectionChanges &SelChange; protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -97,7 +98,7 @@ class GuiExport SoFCEnableSelectionAction : public SoAction public: SoFCEnableSelectionAction (const SbBool& sel); - ~SoFCEnableSelectionAction(); + ~SoFCEnableSelectionAction() override; SbBool selection; @@ -105,7 +106,7 @@ public: static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -130,7 +131,7 @@ public: static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -147,7 +148,7 @@ class GuiExport SoFCSelectionColorAction : public SoAction public: SoFCSelectionColorAction (const SoSFColor& col); - ~SoFCSelectionColorAction(); + ~SoFCSelectionColorAction() override; SoSFColor selectionColor; @@ -155,7 +156,7 @@ public: static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -172,7 +173,7 @@ class GuiExport SoFCHighlightColorAction : public SoAction public: SoFCHighlightColorAction (const SoSFColor& col); - ~SoFCHighlightColorAction(); + ~SoFCHighlightColorAction() override; SoSFColor highlightColor; @@ -180,7 +181,7 @@ public: static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -197,7 +198,7 @@ class GuiExport SoFCDocumentAction : public SoAction public: SoFCDocumentAction (const SoSFString& docName); - ~SoFCDocumentAction(); + ~SoFCDocumentAction() override; SoSFString documentName; @@ -205,7 +206,7 @@ public: static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -222,7 +223,7 @@ class GuiExport SoFCDocumentObjectAction : public SoAction public: SoFCDocumentObjectAction (); - ~SoFCDocumentObjectAction(); + ~SoFCDocumentObjectAction() override; void setHandled(); SbBool isHandled() const; @@ -231,7 +232,7 @@ public: static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -255,7 +256,7 @@ class GuiExport SoGLSelectAction : public SoAction public: SoGLSelectAction (const SbViewportRegion& region, const SbViewportRegion& select); - ~SoGLSelectAction(); + ~SoGLSelectAction() override; void setHandled(); SbBool isHandled() const; @@ -264,7 +265,7 @@ public: static void initClass(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -287,7 +288,7 @@ class GuiExport SoVisibleFaceAction : public SoAction public: SoVisibleFaceAction (); - ~SoVisibleFaceAction(); + ~SoVisibleFaceAction() override; void setHandled(); SbBool isHandled() const; @@ -295,7 +296,7 @@ public: static void initClass(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); @@ -317,13 +318,13 @@ class GuiExport SoBoxSelectionRenderAction : public SoGLRenderAction { public: SoBoxSelectionRenderAction(); SoBoxSelectionRenderAction(const SbViewportRegion & viewportregion); - virtual ~SoBoxSelectionRenderAction(); + ~SoBoxSelectionRenderAction() override; static void initClass(); - virtual void apply(SoNode * node); - virtual void apply(SoPath * path); - virtual void apply(const SoPathList & pathlist, SbBool obeysrules = false); + void apply(SoNode * node) override; + void apply(SoPath * path) override; + void apply(const SoPathList & pathlist, SbBool obeysrules = false) override; void setVisible(SbBool b) { hlVisible = b; } SbBool isVisible() const { return hlVisible; } void setColor(const SbColor & color); @@ -353,13 +354,13 @@ class GuiExport SoUpdateVBOAction : public SoAction public: SoUpdateVBOAction (); - ~SoUpdateVBOAction(); + ~SoUpdateVBOAction() override; static void initClass(); static void finish(); protected: - virtual void beginTraversal(SoNode *node); + void beginTraversal(SoNode *node) override; private: static void callDoAction(SoAction *action,SoNode *node); diff --git a/src/Gui/SoFCVectorizeSVGAction.h b/src/Gui/SoFCVectorizeSVGAction.h index f3f577717d..6325b4e1c0 100644 --- a/src/Gui/SoFCVectorizeSVGAction.h +++ b/src/Gui/SoFCVectorizeSVGAction.h @@ -27,6 +27,7 @@ #include #include +#include namespace Gui { @@ -34,10 +35,10 @@ namespace Gui { class GuiExport SoSVGVectorOutput : public SoVectorOutput { public: SoSVGVectorOutput(); - virtual ~SoSVGVectorOutput(); + ~SoSVGVectorOutput() override; - virtual SbBool openFile (const char *filename); - virtual void closeFile (); + SbBool openFile (const char *filename) override; + void closeFile () override; std::fstream& getFileStream(); private: @@ -55,24 +56,24 @@ class GuiExport SoFCVectorizeSVGAction : public SoVectorizeAction { public: SoFCVectorizeSVGAction(); - virtual ~SoFCVectorizeSVGAction(); + ~SoFCVectorizeSVGAction() override; static void initClass(); SoSVGVectorOutput * getSVGOutput() const; - virtual void setBackgroundState(bool b) { m_backgroundState = b; } - virtual bool getBackgroundState(void) const { return m_backgroundState; } + virtual void setBackgroundState(bool b) { m_backgroundState = b; } + virtual bool getBackgroundState() const { return m_backgroundState; } virtual void setLineWidth(double w) { m_lineWidth = w; } - virtual double getLineWidth(void) const { return m_lineWidth; } + virtual double getLineWidth() const { return m_lineWidth; } virtual void setUseMM(bool b) { m_usemm = b; } - virtual bool getUseMM(void) const { return m_usemm; } + virtual bool getUseMM() const { return m_usemm; } protected: - virtual void printHeader() const; - virtual void printFooter() const; - virtual void printBackground() const; - virtual void printItem(const SoVectorizeItem * item) const; - virtual void printViewport() const; + void printHeader() const override; + void printFooter() const override; + void printBackground() const override; + void printItem(const SoVectorizeItem * item) const override; + void printViewport() const override; private: SoFCVectorizeSVGActionP* p; diff --git a/src/Gui/SoFCVectorizeU3DAction.h b/src/Gui/SoFCVectorizeU3DAction.h index e70f91d8ca..a83655e18b 100644 --- a/src/Gui/SoFCVectorizeU3DAction.h +++ b/src/Gui/SoFCVectorizeU3DAction.h @@ -33,10 +33,10 @@ namespace Gui { class GuiExport SoU3DVectorOutput : public SoVectorOutput { public: SoU3DVectorOutput(); - virtual ~SoU3DVectorOutput(); + ~SoU3DVectorOutput() override; - virtual SbBool openFile (const char *filename); - virtual void closeFile (); + SbBool openFile (const char *filename) override; + void closeFile () override; std::fstream& getFileStream(); private: @@ -54,19 +54,19 @@ class GuiExport SoFCVectorizeU3DAction : public SoVectorizeAction { public: SoFCVectorizeU3DAction(); - virtual ~SoFCVectorizeU3DAction(); + ~SoFCVectorizeU3DAction() override; static void initClass(); SoU3DVectorOutput * getU3DOutput() const; protected: - virtual void beginTraversal(SoNode * node); - virtual void endTraversal(SoNode *node); - virtual void printHeader() const; - virtual void printFooter() const; - virtual void printBackground() const; - virtual void printItem(const SoVectorizeItem * item) const; - virtual void printViewport() const; + void beginTraversal(SoNode * node) override; + void endTraversal(SoNode *node) override; + void printHeader() const override; + void printFooter() const override; + void printBackground() const override; + void printItem(const SoVectorizeItem * item) const override; + void printViewport() const override; private: static void actionMethod(SoAction *, SoNode *); diff --git a/src/Gui/SoMouseWheelEvent.h b/src/Gui/SoMouseWheelEvent.h index de630bbbb5..403f7be256 100644 --- a/src/Gui/SoMouseWheelEvent.h +++ b/src/Gui/SoMouseWheelEvent.h @@ -26,6 +26,7 @@ #include #include +#include /** * @brief The SoMouseWheelEvent class is a temporary replacement for @@ -44,7 +45,7 @@ public: //methods /// smaller values come from high-resolution devices like touchpads int getDelta() const {return delta;} void setDelta(int delta) {this->delta = delta;} - ~SoMouseWheelEvent(){} + ~SoMouseWheelEvent() override {} private: //data int delta; diff --git a/src/Gui/SyntaxHighlighter.h b/src/Gui/SyntaxHighlighter.h index b510bfcc5d..8d208a4b89 100644 --- a/src/Gui/SyntaxHighlighter.h +++ b/src/Gui/SyntaxHighlighter.h @@ -39,7 +39,7 @@ class GuiExport SyntaxHighlighter : public QSyntaxHighlighter { public: SyntaxHighlighter(QObject* parent); - virtual ~SyntaxHighlighter(); + ~SyntaxHighlighter() override; int maximumUserState() const; diff --git a/src/Gui/TaskView/TaskImage.h b/src/Gui/TaskView/TaskImage.h index abbc8107e6..720452238a 100644 --- a/src/Gui/TaskView/TaskImage.h +++ b/src/Gui/TaskView/TaskImage.h @@ -50,9 +50,9 @@ class InteractiveScale : public QObject public: explicit InteractiveScale(View3DInventorViewer* view, ViewProvider* vp, Base::Placement plc); - ~InteractiveScale(); + ~InteractiveScale() override; - bool eventFilter(QObject* object, QEvent* event); + bool eventFilter(QObject* object, QEvent* event) override; void activate(); void deactivate(); bool isActive() const { diff --git a/src/Gui/ToolBox.h b/src/Gui/ToolBox.h index 9ea0bb97d9..586fbb3d2b 100644 --- a/src/Gui/ToolBox.h +++ b/src/Gui/ToolBox.h @@ -23,6 +23,9 @@ #ifndef GUI_DOCKWND_TOOLBOX_H #define GUI_DOCKWND_TOOLBOX_H +#include +#include + class QToolBox; namespace Gui @@ -57,7 +60,7 @@ class GuiExport ToolBox : public QWidget public: ToolBox( QWidget *parent=nullptr ); - virtual ~ToolBox(); + ~ToolBox() override; int addItem ( QWidget * w, const QString & label ); int addItem ( QWidget * item, const QIcon & iconSet, const QString & label ); @@ -90,7 +93,7 @@ public Q_SLOTS: void setCurrentWidget ( QWidget * item ); protected: - void changeEvent(QEvent *e); + void changeEvent(QEvent *e) override; Q_SIGNALS: /** This signal is emitted when the current item changed. diff --git a/src/Gui/TreeParams.cpp b/src/Gui/TreeParams.cpp index 2b068655b1..cf462b0bfc 100644 --- a/src/Gui/TreeParams.cpp +++ b/src/Gui/TreeParams.cpp @@ -159,11 +159,11 @@ public: } // Auto generated code (Tools/params_utils.py:217) - ~TreeParamsP() { + ~TreeParamsP() override { } // Auto generated code (Tools/params_utils.py:222) - void OnChange(Base::Subject &, const char* sReason) { + void OnChange(Base::Subject &, const char* sReason) override { if(!sReason) return; auto it = funcs.find(sReason); diff --git a/src/Gui/ViewProviderExtensionPython.h b/src/Gui/ViewProviderExtensionPython.h index 442ada290d..f995633903 100644 --- a/src/Gui/ViewProviderExtensionPython.h +++ b/src/Gui/ViewProviderExtensionPython.h @@ -34,9 +34,9 @@ namespace Gui { * derived class as Python extension -- simply by subclassing. */ template -class ViewProviderExtensionPythonT : public ExtensionT +class ViewProviderExtensionPythonT : public ExtensionT //NOLINT { - EXTENSION_PROPERTY_HEADER(Gui::ViewProviderExtensionPythonT); + EXTENSION_PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderExtensionPythonT); public: using Inherited = ExtensionT; @@ -45,8 +45,7 @@ public: ExtensionT::m_isPythonExtension = true; ExtensionT::initExtensionType(ViewProviderExtensionPythonT::getExtensionClassTypeId()); } - virtual ~ViewProviderExtensionPythonT() { - } + ~ViewProviderExtensionPythonT() override = default; ViewProviderExtensionPythonT(const ViewProviderExtensionPythonT&) = delete; ViewProviderExtensionPythonT(ViewProviderExtensionPythonT&&) = delete; diff --git a/src/Gui/ViewProviderPythonFeature.h b/src/Gui/ViewProviderPythonFeature.h index 1aad2b0c86..719434e28e 100644 --- a/src/Gui/ViewProviderPythonFeature.h +++ b/src/Gui/ViewProviderPythonFeature.h @@ -204,7 +204,7 @@ public: imp = new ViewProviderPythonFeatureImp(this,Proxy); } /// destructor. - virtual ~ViewProviderPythonFeatureT() { + virtual ~ViewProviderPythonFeatureT() override { delete imp; }