ads: Remove redundant occurrences of "virtual"

As suggested by clang-tidy's "modernize-use-override" check and to match
Qt Creator's coding guidelines.

Change-Id: I2cfef113e21a0cd44d18a5b98e9bc8427563c53a
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Alessandro Portale
2020-06-14 14:41:00 +02:00
parent 0795d5f42d
commit d3f85ee409
13 changed files with 74 additions and 74 deletions

View File

@@ -71,7 +71,7 @@ private:
void onTabWidgetMoved(const QPoint &globalPos); void onTabWidgetMoved(const QPoint &globalPos);
protected: protected:
virtual void wheelEvent(QWheelEvent *event) override; void wheelEvent(QWheelEvent *event) override;
public: public:
using Super = QScrollArea; using Super = QScrollArea;
@@ -84,7 +84,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockAreaTabBar() override; ~DockAreaTabBar() override;
/** /**
* Inserts the given dock widget tab at the given position. * Inserts the given dock widget tab at the given position.
@@ -121,7 +121,7 @@ public:
/** /**
* Filters the tab widget events * Filters the tab widget events
*/ */
virtual bool eventFilter(QObject *watched, QEvent *event) override; bool eventFilter(QObject *watched, QEvent *event) override;
/** /**
* This function returns true if the tab is open, that means if it is * This function returns true if the tab is open, that means if it is
@@ -137,13 +137,13 @@ public:
* is reserved in the minimumSizeHint(). This override simply returns * is reserved in the minimumSizeHint(). This override simply returns
* sizeHint(); * sizeHint();
*/ */
virtual QSize minimumSizeHint() const override; QSize minimumSizeHint() const override;
/** /**
* The function provides a sizeHint that matches the height of the * The function provides a sizeHint that matches the height of the
* internal viewport. * internal viewport.
*/ */
virtual QSize sizeHint() const override; QSize sizeHint() const override;
/** /**
* This property sets the index of the tab bar's visible tab * This property sets the index of the tab bar's visible tab

View File

@@ -70,7 +70,7 @@ public:
/** /**
* Adjust this visibility change request with our internal settings: * Adjust this visibility change request with our internal settings:
*/ */
virtual void setVisible(bool visible) override; void setVisible(bool visible) override;
protected: protected:
/** /**
@@ -92,8 +92,8 @@ class SpacerWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
SpacerWidget(QWidget *parent = nullptr); SpacerWidget(QWidget *parent = nullptr);
virtual QSize sizeHint() const override {return QSize(0, 0);} QSize sizeHint() const override {return QSize(0, 0);}
virtual QSize minimumSizeHint() const override {return QSize(0, 0);} QSize minimumSizeHint() const override {return QSize(0, 0);}
}; };
/** /**
@@ -118,28 +118,28 @@ protected:
/** /**
* Stores mouse position to detect dragging * Stores mouse position to detect dragging
*/ */
virtual void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;
/** /**
* Stores mouse position to detect dragging * Stores mouse position to detect dragging
*/ */
virtual void mouseReleaseEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override;
/** /**
* Starts floating the complete docking area including all dock widgets, * Starts floating the complete docking area including all dock widgets,
* if it is not the last dock area in a floating widget * if it is not the last dock area in a floating widget
*/ */
virtual void mouseMoveEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override;
/** /**
* Double clicking the title bar also starts floating of the complete area * Double clicking the title bar also starts floating of the complete area
*/ */
virtual void mouseDoubleClickEvent(QMouseEvent *event) override; void mouseDoubleClickEvent(QMouseEvent *event) override;
/** /**
* Show context menu * Show context menu
*/ */
virtual void contextMenuEvent(QContextMenuEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override;
public: public:
/** /**
@@ -157,7 +157,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockAreaTitleBar() override; ~DockAreaTitleBar() override;
/** /**
* Returns the pointer to the tabBar() * Returns the pointer to the tabBar()
@@ -178,7 +178,7 @@ public:
* Marks the tabs menu outdated before it calls its base class * Marks the tabs menu outdated before it calls its base class
* implementation * implementation
*/ */
virtual void setVisible(bool visible) override; void setVisible(bool visible) override;
/** /**
* Inserts a custom widget at position index into this title bar. * Inserts a custom widget at position index into this title bar.

View File

@@ -155,7 +155,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockAreaWidget() override; ~DockAreaWidget() override;
/** /**
* Returns the dock manager object this dock area belongs to * Returns the dock manager object this dock area belongs to
@@ -257,7 +257,7 @@ public:
/** /**
* Update the close button if visibility changed * Update the close button if visibility changed
*/ */
virtual void setVisible(bool visible) override; void setVisible(bool visible) override;
/** /**
* Configures the areas of this particular dock area that are allowed for docking * Configures the areas of this particular dock area that are allowed for docking
@@ -296,7 +296,7 @@ public:
* area. * area.
* The minimum size hint is updated if a dock widget is removed or added. * The minimum size hint is updated if a dock widget is removed or added.
*/ */
virtual QSize minimumSizeHint() const override; QSize minimumSizeHint() const override;
signals: signals:
/** /**

View File

@@ -84,7 +84,7 @@ protected:
/** /**
* Handles activation events to update zOrderIndex * Handles activation events to update zOrderIndex
*/ */
virtual bool event(QEvent *event) override; bool event(QEvent *event) override;
public: // TODO temporary public: // TODO temporary
/** /**
@@ -177,7 +177,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockContainerWidget() override; ~DockContainerWidget() override;
/** /**
* Adds dockwidget into the given area. * Adds dockwidget into the given area.

View File

@@ -145,7 +145,7 @@ protected:
/** /**
* Show the floating widgets that has been created floating * Show the floating widgets that has been created floating
*/ */
virtual void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;
public: public:
using Super = DockContainerWidget; using Super = DockContainerWidget;
@@ -229,7 +229,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockManager() override; ~DockManager() override;
/** /**
* This function returns the global configuration flags. * This function returns the global configuration flags.
@@ -349,7 +349,7 @@ public:
* This function always return 0 because the main window is always behind * This function always return 0 because the main window is always behind
* any floating widget. * any floating widget.
*/ */
virtual unsigned int zOrderIndex() const override; unsigned int zOrderIndex() const override;
/** /**
* Saves the current state of the dockmanger and all its dock widgets * Saves the current state of the dockmanger and all its dock widgets

View File

@@ -76,7 +76,7 @@ public:
/** /**
* Virtual destructor * Virtual destructor
*/ */
virtual ~DockOverlay() override; ~DockOverlay() override;
/** /**
* Configures the areas that are allowed for docking * Configures the areas that are allowed for docking
@@ -129,12 +129,12 @@ public:
/** /**
* Handle polish events * Handle polish events
*/ */
virtual bool event(QEvent *event) override; bool event(QEvent *event) override;
protected: protected:
virtual void paintEvent(QPaintEvent *event) override; void paintEvent(QPaintEvent *event) override;
virtual void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;
virtual void hideEvent(QHideEvent *event) override; void hideEvent(QHideEvent *event) override;
}; };
class DockOverlayCrossPrivate; class DockOverlayCrossPrivate;
@@ -212,7 +212,7 @@ public:
/** /**
* Virtual destructor * Virtual destructor
*/ */
virtual ~DockOverlayCross() override; ~DockOverlayCross() override;
/** /**
* Sets a certain icon color * Sets a certain icon color
@@ -265,7 +265,7 @@ public:
void setIconColors(const QString &colors); void setIconColors(const QString &colors);
protected: protected:
virtual void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;
void setAreaWidgets(const QHash<DockWidgetArea, QWidget *> &widgets); void setAreaWidgets(const QHash<DockWidgetArea, QWidget *> &widgets);
}; // DockOverlayCross }; // DockOverlayCross

View File

@@ -61,7 +61,7 @@ public:
/** /**
* Prints debug info * Prints debug info
*/ */
virtual ~DockSplitter() override; ~DockSplitter() override;
/** /**
* Returns true, if any of the internal widgets is visible * Returns true, if any of the internal widgets is visible

View File

@@ -226,13 +226,13 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockWidget() override; ~DockWidget() override;
/** /**
* We return a fixed minimum size hint or the size hint of the content * We return a fixed minimum size hint or the size hint of the content
* widget if minimum size hint mode is MinimumSizeHintFromContent * widget if minimum size hint mode is MinimumSizeHintFromContent
*/ */
virtual QSize minimumSizeHint() const override; QSize minimumSizeHint() const override;
/** /**
* Sets the widget for the dock widget to widget. * Sets the widget for the dock widget to widget.
@@ -439,7 +439,7 @@ public: // reimplements QFrame
/** /**
* Emits titleChanged signal if title change event occurs * Emits titleChanged signal if title change event occurs
*/ */
virtual bool event(QEvent *event) override; bool event(QEvent *event) override;
/** /**
* This property controls whether the dock widget is open or closed. * This property controls whether the dock widget is open or closed.

View File

@@ -63,15 +63,15 @@ private:
void detachDockWidget(); void detachDockWidget();
protected: protected:
virtual void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override;
virtual void mouseMoveEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override;
virtual void contextMenuEvent(QContextMenuEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override;
/** /**
* Double clicking the tab widget makes the assigned dock widget floating * Double clicking the tab widget makes the assigned dock widget floating
*/ */
virtual void mouseDoubleClickEvent(QMouseEvent *event) override; void mouseDoubleClickEvent(QMouseEvent *event) override;
public: public:
using Super = QFrame; using Super = QFrame;
@@ -85,7 +85,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~DockWidgetTab() override; ~DockWidgetTab() override;
/** /**
* Returns true, if this is the active tab * Returns true, if this is the active tab
@@ -148,9 +148,9 @@ public:
/** /**
* Track event ToolTipChange and set child ToolTip * Track event ToolTipChange and set child ToolTip
*/ */
virtual bool event(QEvent *event) override; bool event(QEvent *event) override;
virtual void setVisible(bool visible) override; void setVisible(bool visible) override;
signals: signals:
void activeTabChanged(); void activeTabChanged();

View File

@@ -57,16 +57,16 @@ private:
friend struct ElidingLabelPrivate; friend struct ElidingLabelPrivate;
protected: protected:
virtual void mouseReleaseEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override; void resizeEvent(QResizeEvent *event) override;
virtual void mouseDoubleClickEvent(QMouseEvent *ev) override; void mouseDoubleClickEvent(QMouseEvent *ev) override;
public: public:
using Super = QLabel; using Super = QLabel;
ElidingLabel(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget); ElidingLabel(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget);
ElidingLabel(const QString &text, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget); ElidingLabel(const QString &text, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Widget);
virtual ~ElidingLabel() override; ~ElidingLabel() override;
/** /**
* Returns the text elide mode. * Returns the text elide mode.
@@ -85,8 +85,8 @@ public:
bool isElided() const; bool isElided() const;
public: // reimplements QLabel public: // reimplements QLabel
virtual QSize minimumSizeHint() const override; QSize minimumSizeHint() const override;
virtual QSize sizeHint() const override; QSize sizeHint() const override;
void setText(const QString &text); void setText(const QString &text);
QString text() const; QString text() const;

View File

@@ -132,10 +132,10 @@ protected:
* Use moveToGlobalPos() to move the widget to a new position * Use moveToGlobalPos() to move the widget to a new position
* depending on the start position given in Pos parameter * depending on the start position given in Pos parameter
*/ */
virtual void startFloating(const QPoint &dragStartMousePos, void startFloating(const QPoint &dragStartMousePos,
const QSize &size, const QSize &size,
eDragState dragState, eDragState dragState,
QWidget *mouseEventHandler) override; QWidget *mouseEventHandler) override;
/** /**
* Call this function to start dragging the floating widget * Call this function to start dragging the floating widget
@@ -151,7 +151,7 @@ protected:
* Call this function if you explicitly want to signal that dragging has * Call this function if you explicitly want to signal that dragging has
* finished * finished
*/ */
virtual void finishDragging() override; void finishDragging() override;
/** /**
* Call this function if you just want to initialize the position * Call this function if you just want to initialize the position
@@ -182,13 +182,13 @@ protected:
void updateWindowTitle(); void updateWindowTitle();
protected: // reimplements QWidget protected: // reimplements QWidget
virtual void changeEvent(QEvent *event) override; void changeEvent(QEvent *event) override;
virtual void moveEvent(QMoveEvent *event) override; void moveEvent(QMoveEvent *event) override;
virtual bool event(QEvent *event) override; bool event(QEvent *event) override;
virtual void closeEvent(QCloseEvent *event) override; void closeEvent(QCloseEvent *event) override;
virtual void hideEvent(QHideEvent *event) override; void hideEvent(QHideEvent *event) override;
virtual void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;
virtual bool eventFilter(QObject *watched, QEvent *event) override; bool eventFilter(QObject *watched, QEvent *event) override;
public: public:
using Super = QWidget; using Super = QWidget;
@@ -211,7 +211,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~FloatingDockContainer() override; ~FloatingDockContainer() override;
/** /**
* Access function for the internal dock container * Access function for the internal dock container

View File

@@ -67,12 +67,12 @@ protected:
/** /**
* Updates the drop overlays * Updates the drop overlays
*/ */
virtual void moveEvent(QMoveEvent *event) override; void moveEvent(QMoveEvent *event) override;
/** /**
* Cares about painting the * Cares about painting the
*/ */
virtual void paintEvent(QPaintEvent *event) override; void paintEvent(QPaintEvent *event) override;
/** /**
* The content is a DockArea or a DockWidget * The content is a DockArea or a DockWidget
@@ -102,26 +102,26 @@ public:
* We filter the events of the assigned content widget to receive * We filter the events of the assigned content widget to receive
* escape key presses for canceling the drag operation * escape key presses for canceling the drag operation
*/ */
virtual bool eventFilter(QObject *watched, QEvent *event) override; bool eventFilter(QObject *watched, QEvent *event) override;
public: // implements AbstractFloatingWidget public: // implements AbstractFloatingWidget
virtual void startFloating(const QPoint &dragStartMousePos, void startFloating(const QPoint &dragStartMousePos,
const QSize &size, const QSize &size,
eDragState dragState, eDragState dragState,
QWidget *mouseEventHandler) override; QWidget *mouseEventHandler) override;
/** /**
* Moves the widget to a new position relative to the position given when * Moves the widget to a new position relative to the position given when
* startFloating() was called * startFloating() was called
*/ */
virtual void moveFloating() override; void moveFloating() override;
/** /**
* Finishes dragging. * Finishes dragging.
* Hides the dock overlays and executes the real undocking and docking * Hides the dock overlays and executes the real undocking and docking
* of the assigned Content widget * of the assigned Content widget
*/ */
virtual void finishDragging() override; void finishDragging() override;
signals: signals:
/** /**

View File

@@ -46,9 +46,9 @@ private:
FloatingWidgetTitleBarPrivate *d; ///< private data (pimpl) FloatingWidgetTitleBarPrivate *d; ///< private data (pimpl)
protected: protected:
virtual void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override;
virtual void mouseMoveEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override;
public: public:
using Super = QWidget; using Super = QWidget;
@@ -57,7 +57,7 @@ public:
/** /**
* Virtual Destructor * Virtual Destructor
*/ */
virtual ~FloatingWidgetTitleBar() override; ~FloatingWidgetTitleBar() override;
/** /**
* Enables / disables the window close button. * Enables / disables the window close button.