From 97ed5ef910e46370daea3dd8f8c75505a19f1bd4 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 18 Nov 2020 15:23:34 +0100 Subject: [PATCH] Add missing "override" to functions of exported classes ...exported ones or "shared" by other means Change-Id: Ic4cc7a71426845c46bf3994a62b73b4ab5da321e Reviewed-by: Alessandro Portale --- src/libs/clangsupport/connectionclient.h | 2 +- src/libs/qmleditorwidgets/colorbox.h | 8 +++---- .../qmleditorwidgets/contextpanetextwidget.h | 2 +- .../qmleditorwidgets/contextpanewidgetimage.h | 6 ++--- .../contextpanewidgetrectangle.h | 2 +- src/libs/qmleditorwidgets/huecontrol.h | 8 +++---- src/libs/ssh/sftpfilesystemmodel.h | 14 ++++++------ src/shared/help/bookmarkmanager.h | 8 +++---- src/shared/help/contentwindow.h | 2 +- src/shared/help/indexwindow.h | 22 +++++++++---------- src/shared/help/topicchooser.h | 2 +- .../qtsingleapplication/qtsingleapplication.h | 2 +- 12 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/libs/clangsupport/connectionclient.h b/src/libs/clangsupport/connectionclient.h index c3ded380293..258bb323d13 100644 --- a/src/libs/clangsupport/connectionclient.h +++ b/src/libs/clangsupport/connectionclient.h @@ -98,7 +98,7 @@ protected: virtual QString outputName() const = 0; QString connectionName() const; - bool event(QEvent* event); + bool event(QEvent* event) override; virtual void newConnectedServer(QLocalSocket *localSocket) = 0; diff --git a/src/libs/qmleditorwidgets/colorbox.h b/src/libs/qmleditorwidgets/colorbox.h index 52dfdf65859..f7fd604d4fc 100644 --- a/src/libs/qmleditorwidgets/colorbox.h +++ b/src/libs/qmleditorwidgets/colorbox.h @@ -69,11 +69,11 @@ signals: void alphaChanged(); protected: - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event) override; - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); + void mousePressEvent(QMouseEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void mouseMoveEvent(QMouseEvent *) override; void setCurrent(int x, int y); private: diff --git a/src/libs/qmleditorwidgets/contextpanetextwidget.h b/src/libs/qmleditorwidgets/contextpanetextwidget.h index 2fbb1b304bf..d97b60f387f 100644 --- a/src/libs/qmleditorwidgets/contextpanetextwidget.h +++ b/src/libs/qmleditorwidgets/contextpanetextwidget.h @@ -71,7 +71,7 @@ signals: void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool removeFirst); protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) override; private: Ui::ContextPaneTextWidget *ui; diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.h b/src/libs/qmleditorwidgets/contextpanewidgetimage.h index 89c7413e77b..1954de4eef4 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetimage.h +++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.h @@ -142,9 +142,9 @@ public: void onRightMarginsChanged(); protected: - void changeEvent(QEvent *e); - void hideEvent(QHideEvent* event); - void showEvent(QShowEvent* event); + void changeEvent(QEvent *e) override; + void hideEvent(QHideEvent* event) override; + void showEvent(QShowEvent* event) override; private: Ui::ContextPaneWidgetImage *ui; diff --git a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h index 1ae75cc9827..db92838fc8f 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h +++ b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.h @@ -64,7 +64,7 @@ signals: void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool removeFirst); protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) override; private: void setColor(); diff --git a/src/libs/qmleditorwidgets/huecontrol.h b/src/libs/qmleditorwidgets/huecontrol.h index 902b3ceaa85..b28759c20fa 100644 --- a/src/libs/qmleditorwidgets/huecontrol.h +++ b/src/libs/qmleditorwidgets/huecontrol.h @@ -49,10 +49,10 @@ signals: void hueChanged(int hue); protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); + void paintEvent(QPaintEvent *) override; + void mousePressEvent(QMouseEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void mouseMoveEvent(QMouseEvent *) override; void setCurrent(int y); private: diff --git a/src/libs/ssh/sftpfilesystemmodel.h b/src/libs/ssh/sftpfilesystemmodel.h index 96ba2a2a544..ea16568d933 100644 --- a/src/libs/ssh/sftpfilesystemmodel.h +++ b/src/libs/ssh/sftpfilesystemmodel.h @@ -57,7 +57,7 @@ public: // Use this to get the full path of a file or directory. static const int PathRole = Qt::UserRole; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; signals: /* @@ -84,12 +84,12 @@ private: void handleFileInfo(QSsh::SftpJobId jobId, const QList &fileInfoList); void handleSftpJobFinished(QSsh::SftpJobId jobId, const QString &errorMessage); - int columnCount(const QModelIndex &parent = QModelIndex()) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + Qt::ItemFlags flags(const QModelIndex &index) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; void statRootDirectory(); void shutDown(); diff --git a/src/shared/help/bookmarkmanager.h b/src/shared/help/bookmarkmanager.h index 885346df87f..0a63b1fa9a8 100644 --- a/src/shared/help/bookmarkmanager.h +++ b/src/shared/help/bookmarkmanager.h @@ -73,7 +73,7 @@ private: void selectBookmarkFolder(int index); void customContextMenuRequested(const QPoint &point); void currentChanged(const QModelIndex& current); - bool eventFilter(QObject *object, QEvent *e); + bool eventFilter(QObject *object, QEvent *e) override; QString m_url; QString m_title; @@ -120,7 +120,7 @@ private: void customContextMenuRequested(const QPoint &point); void setup(); void expandItems(); - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(QObject *object, QEvent *event) override; QRegularExpression regExp; TreeView *treeView; @@ -138,8 +138,8 @@ public: BookmarkModel(int rows, int columns, QObject *parent = 0); ~BookmarkModel(); - Qt::DropActions supportedDropActions() const; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::DropActions supportedDropActions() const override; + Qt::ItemFlags flags(const QModelIndex &index) const override; }; class BookmarkManager : public QObject diff --git a/src/shared/help/contentwindow.h b/src/shared/help/contentwindow.h index 99ec3cbca58..887bd935701 100644 --- a/src/shared/help/contentwindow.h +++ b/src/shared/help/contentwindow.h @@ -58,7 +58,7 @@ private: void expandTOC(); void itemActivated(const QModelIndex &index); void expandToDepth(int depth); - bool eventFilter(QObject *o, QEvent *e); + bool eventFilter(QObject *o, QEvent *e) override; Utils::NavigationTreeView *m_contentWidget; QHelpContentModel *m_contentModel; diff --git a/src/shared/help/indexwindow.h b/src/shared/help/indexwindow.h index 8b1dec0872d..5fe0712dca1 100644 --- a/src/shared/help/indexwindow.h +++ b/src/shared/help/indexwindow.h @@ -51,20 +51,20 @@ public: IndexFilterModel(QObject *parent); QModelIndex filter(const QString &filter, const QString &wildcard); - QModelIndex mapToSource(const QModelIndex &proxyIndex) const; - QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; - Qt::DropActions supportedDragActions() const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + QModelIndex mapToSource(const QModelIndex &proxyIndex) const override; + QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override; + Qt::DropActions supportedDragActions() const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; - void setSourceModel(QAbstractItemModel *sm); + void setSourceModel(QAbstractItemModel *sm) override; // QAbstractProxyModel::sibling is broken in Qt 5 - QModelIndex sibling(int row, int column, const QModelIndex &idx) const; + QModelIndex sibling(int row, int column, const QModelIndex &idx) const override; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; private: void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); @@ -95,7 +95,7 @@ private: void filterIndices(const QString &filter); void enableSearchLineEdit(); void disableSearchLineEdit(); - bool eventFilter(QObject *obj, QEvent *e); + bool eventFilter(QObject *obj, QEvent *e) override; void open(const QModelIndex &index, bool newPage = false); Utils::FancyLineEdit *m_searchLineEdit; diff --git a/src/shared/help/topicchooser.h b/src/shared/help/topicchooser.h index 8f278428c71..7d47b13712b 100644 --- a/src/shared/help/topicchooser.h +++ b/src/shared/help/topicchooser.h @@ -50,7 +50,7 @@ private: void acceptDialog(); void setFilter(const QString &pattern); void activated(const QModelIndex &index); - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(QObject *object, QEvent *event) override; Ui::TopicChooser ui; QList m_links; diff --git a/src/shared/qtsingleapplication/qtsingleapplication.h b/src/shared/qtsingleapplication/qtsingleapplication.h index d4a0e1bb6a3..4da973895f8 100644 --- a/src/shared/qtsingleapplication/qtsingleapplication.h +++ b/src/shared/qtsingleapplication/qtsingleapplication.h @@ -43,7 +43,7 @@ public: void setActivationWindow(QWidget* aw, bool activateOnMessage = true); QWidget* activationWindow() const; - bool event(QEvent *event); + bool event(QEvent *event) override; QString applicationId() const; void setBlock(bool value);