Fix missing overrides and redundant virtual

Change-Id: Id2a247b6032602c2295d928067c2462d3f9b5221
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Alessandro Portale
2023-11-14 14:24:48 +01:00
parent 6491e378e4
commit f96feadad0
50 changed files with 174 additions and 170 deletions

View File

@@ -45,7 +45,7 @@ public:
class TASKING_EXPORT QProcessAdapter : public TaskAdapter<QProcess, QProcessDeleter> class TASKING_EXPORT QProcessAdapter : public TaskAdapter<QProcess, QProcessDeleter>
{ {
private: private:
void start() { void start() override {
connect(task(), &QProcess::finished, this, [this] { connect(task(), &QProcess::finished, this, [this] {
const bool success = task()->exitStatus() == QProcess::NormalExit const bool success = task()->exitStatus() == QProcess::NormalExit
&& task()->error() == QProcess::UnknownError && task()->error() == QProcess::UnknownError

View File

@@ -3227,7 +3227,7 @@ public:
: QWidget(parent) : QWidget(parent)
, m_index(idx) , m_index(idx)
{} {}
void paintEvent(QPaintEvent *event) void paintEvent(QPaintEvent *event) override
{ {
QPainter p(this); QPainter p(this);
QPalette pal = palette(); QPalette pal = palette();

View File

@@ -202,7 +202,7 @@ public:
class DefaultImpl : public ProcessInterface class DefaultImpl : public ProcessInterface
{ {
private: private:
virtual void start() final; void start() final;
virtual void doDefaultStart(const QString &program, const QStringList &arguments) = 0; virtual void doDefaultStart(const QString &program, const QStringList &arguments) = 0;
bool dissolveCommand(QString *program, QStringList *arguments); bool dissolveCommand(QString *program, QStringList *arguments);
bool ensureProgramExists(const QString &program); bool ensureProgramExists(const QString &program);
@@ -481,7 +481,7 @@ private:
} }
} }
virtual ProcessBlockingInterface *processBlockingInterface() const { return m_blockingImpl; } ProcessBlockingInterface *processBlockingInterface() const override { return m_blockingImpl; }
void doDefaultStart(const QString &program, const QStringList &arguments) final void doDefaultStart(const QString &program, const QStringList &arguments) final
{ {
@@ -614,7 +614,7 @@ private:
} }
} }
virtual ProcessBlockingInterface *processBlockingInterface() const { return m_blockingImpl; } ProcessBlockingInterface *processBlockingInterface() const override { return m_blockingImpl; }
void doDefaultStart(const QString &program, const QStringList &arguments) final void doDefaultStart(const QString &program, const QStringList &arguments) final
{ {

View File

@@ -129,7 +129,7 @@ class QTCREATOR_UTILS_EXPORT MarkdownHighlighter : public QSyntaxHighlighter
{ {
public: public:
MarkdownHighlighter(QTextDocument *parent); MarkdownHighlighter(QTextDocument *parent);
void highlightBlock(const QString &text); void highlightBlock(const QString &text) override;
private: private:
QBrush codeBgBrush(); QBrush codeBgBrush();

View File

@@ -99,7 +99,7 @@ public Q_SLOTS:
protected: protected:
virtual bool isUpdateNeeded() const; virtual bool isUpdateNeeded() const;
virtual void updateCurrentTime(int time) override; void updateCurrentTime(int time) override;
private: private:
int m_delay; int m_delay;

View File

@@ -24,7 +24,7 @@ public:
virtual ~TransientScrollAreaSupport(); virtual ~TransientScrollAreaSupport();
protected: protected:
virtual bool eventFilter(QObject *watched, QEvent *event) override; bool eventFilter(QObject *watched, QEvent *event) override;
private: private:
explicit TransientScrollAreaSupport(QAbstractScrollArea *scrollArea); explicit TransientScrollAreaSupport(QAbstractScrollArea *scrollArea);
@@ -66,6 +66,6 @@ public:
private: private:
GlobalTransientSupport(); GlobalTransientSupport();
static GlobalTransientSupport *instance(); static GlobalTransientSupport *instance();
virtual bool eventFilter(QObject *watched, QEvent *event) override; bool eventFilter(QObject *watched, QEvent *event) override;
}; };
} }

View File

@@ -19,7 +19,7 @@ public:
QString buildKey() const; QString buildKey() const;
void setBuildKey(const QString &buildKey); void setBuildKey(const QString &buildKey);
void accept(); void accept() override;
bool copyGradle(); bool copyGradle();
void setDirectory(const Utils::FilePath &directory); void setDirectory(const Utils::FilePath &directory);

View File

@@ -124,7 +124,7 @@ public:
explicit TestToolConfiguration(ITestBase *testBase) : ITestConfiguration(testBase) {} explicit TestToolConfiguration(ITestBase *testBase) : ITestConfiguration(testBase) {}
Utils::CommandLine commandLine() const { return m_commandLine; } Utils::CommandLine commandLine() const { return m_commandLine; }
void setCommandLine(const Utils::CommandLine &cmdline) { m_commandLine = cmdline; } void setCommandLine(const Utils::CommandLine &cmdline) { m_commandLine = cmdline; }
virtual Utils::FilePath testExecutable() const override { return m_commandLine.executable(); }; Utils::FilePath testExecutable() const override { return m_commandLine.executable(); };
private: private:
Utils::CommandLine m_commandLine; Utils::CommandLine m_commandLine;

View File

@@ -55,9 +55,9 @@ public:
const Utils::FilePath &filePath = {}, const Utils::FilePath &filePath = {},
Type type = Root); Type type = Root);
virtual QVariant data(int column, int role) const override; QVariant data(int column, int role) const override;
virtual bool setData(int column, const QVariant &data, int role) override; bool setData(int column, const QVariant &data, int role) override;
virtual Qt::ItemFlags flags(int column) const override; Qt::ItemFlags flags(int column) const override;
virtual Qt::CheckState checked() const; virtual Qt::CheckState checked() const;
virtual bool canProvideTestConfiguration() const { return false; } virtual bool canProvideTestConfiguration() const { return false; }
@@ -102,7 +102,7 @@ public:
Type type = Root); Type type = Root);
virtual TestTreeItem *copyWithoutChildren() = 0; virtual TestTreeItem *copyWithoutChildren() = 0;
virtual QVariant data(int column, int role) const override; QVariant data(int column, int role) const override;
bool modifyTestCaseOrSuiteContent(const TestParseResult *result); bool modifyTestCaseOrSuiteContent(const TestParseResult *result);
bool modifyTestFunctionContent(const TestParseResult *result); bool modifyTestFunctionContent(const TestParseResult *result);
bool modifyDataTagContent(const TestParseResult *result); bool modifyDataTagContent(const TestParseResult *result);

View File

@@ -126,7 +126,7 @@ namespace Axivion::Internal::Dto
// Throws std::bad_variant_access // Throws std::bad_variant_access
const bool &getBool() const; const bool &getBool() const;
virtual QByteArray serialize() const override; QByteArray serialize() const override;
private: private:
std::variant< std::variant<
@@ -179,7 +179,7 @@ namespace Axivion::Internal::Dto
std::optional<QString> languageName std::optional<QString> languageName
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -252,7 +252,7 @@ namespace Axivion::Internal::Dto
QString newPassword QString newPassword
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -292,7 +292,7 @@ namespace Axivion::Internal::Dto
QString displayColor QString displayColor
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -314,7 +314,7 @@ namespace Axivion::Internal::Dto
QString text QString text
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -342,7 +342,7 @@ namespace Axivion::Internal::Dto
QString csrfToken QString csrfToken
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -389,7 +389,7 @@ namespace Axivion::Internal::Dto
std::optional<qint32> line std::optional<qint32> line
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -510,7 +510,7 @@ namespace Axivion::Internal::Dto
std::optional<std::map<QString, Any>> data std::optional<std::map<QString, Any>> data
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -577,7 +577,7 @@ namespace Axivion::Internal::Dto
std::optional<QString> commentDeletionId std::optional<QString> commentDeletionId
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -723,7 +723,7 @@ namespace Axivion::Internal::Dto
qint32 endColumn qint32 endColumn
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -754,7 +754,7 @@ namespace Axivion::Internal::Dto
QString color QString color
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -814,7 +814,7 @@ namespace Axivion::Internal::Dto
std::optional<bool> selected std::optional<bool> selected
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -898,7 +898,7 @@ namespace Axivion::Internal::Dto
Any maxValue Any maxValue
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -960,7 +960,7 @@ namespace Axivion::Internal::Dto
QString entityId QString entityId
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1020,7 +1020,7 @@ namespace Axivion::Internal::Dto
std::optional<std::vector<QString>> groups std::optional<std::vector<QString>> groups
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1048,7 +1048,7 @@ namespace Axivion::Internal::Dto
QString url QString url
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1087,7 +1087,7 @@ namespace Axivion::Internal::Dto
std::optional<bool> disabled std::optional<bool> disabled
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1178,7 +1178,7 @@ namespace Axivion::Internal::Dto
QString buildDate QString buildDate
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1244,7 +1244,7 @@ namespace Axivion::Internal::Dto
qint32 Removed qint32 Removed
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1358,7 +1358,7 @@ namespace Axivion::Internal::Dto
std::optional<double> cloneRatio std::optional<double> cloneRatio
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1423,7 +1423,7 @@ namespace Axivion::Internal::Dto
void setTypeEnum(ApiTokenType newValue); void setTypeEnum(ApiTokenType newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1557,7 +1557,7 @@ namespace Axivion::Internal::Dto
void setTypeEnum(ApiTokenType newValue); void setTypeEnum(ApiTokenType newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1672,7 +1672,7 @@ namespace Axivion::Internal::Dto
void setAlignmentEnum(TableCellAlignment newValue); void setAlignmentEnum(TableCellAlignment newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1816,7 +1816,7 @@ namespace Axivion::Internal::Dto
std::optional<QString> csrfTokenUrl std::optional<QString> csrfTokenUrl
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1838,7 +1838,7 @@ namespace Axivion::Internal::Dto
std::vector<IssueCommentDto> comments std::vector<IssueCommentDto> comments
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1885,7 +1885,7 @@ namespace Axivion::Internal::Dto
void setPrefixEnum(IssueKind newValue); void setPrefixEnum(IssueKind newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -1907,7 +1907,7 @@ namespace Axivion::Internal::Dto
std::vector<IssueTagTypeDto> tags std::vector<IssueTagTypeDto> tags
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2022,7 +2022,7 @@ namespace Axivion::Internal::Dto
void setKindEnum(IssueKind newValue); void setKindEnum(IssueKind newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2065,7 +2065,7 @@ namespace Axivion::Internal::Dto
void setSeverityEnum(std::optional<MessageSeverity> newValue); void setSeverityEnum(std::optional<MessageSeverity> newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2087,7 +2087,7 @@ namespace Axivion::Internal::Dto
std::vector<RuleDto> rules std::vector<RuleDto> rules
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2127,7 +2127,7 @@ namespace Axivion::Internal::Dto
void setDirectionEnum(SortDirection newValue); void setDirectionEnum(SortDirection newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2185,7 +2185,7 @@ namespace Axivion::Internal::Dto
void setTypeEnum(std::optional<UserRefType> newValue); void setTypeEnum(std::optional<UserRefType> newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2213,7 +2213,7 @@ namespace Axivion::Internal::Dto
std::vector<AnalyzedFileDto> rows std::vector<AnalyzedFileDto> rows
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2241,7 +2241,7 @@ namespace Axivion::Internal::Dto
std::vector<EntityDto> entities std::vector<EntityDto> entities
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2291,7 +2291,7 @@ namespace Axivion::Internal::Dto
std::vector<LineMarkerDto> lineMarkers std::vector<LineMarkerDto> lineMarkers
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2372,7 +2372,7 @@ namespace Axivion::Internal::Dto
void setKindEnum(IssueKind newValue); void setKindEnum(IssueKind newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2470,7 +2470,7 @@ namespace Axivion::Internal::Dto
std::optional<qint32> totalRemovedCount std::optional<qint32> totalRemovedCount
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2498,7 +2498,7 @@ namespace Axivion::Internal::Dto
std::vector<MetricDto> metrics std::vector<MetricDto> metrics
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2552,7 +2552,7 @@ namespace Axivion::Internal::Dto
std::vector<std::optional<double>> values std::vector<std::optional<double>> values
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2582,7 +2582,7 @@ namespace Axivion::Internal::Dto
std::vector<MetricValueTableRowDto> rows std::vector<MetricValueTableRowDto> rows
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2660,7 +2660,7 @@ namespace Axivion::Internal::Dto
void setKindEnum(IssueKindForNamedFilterCreation newValue); void setKindEnum(IssueKindForNamedFilterCreation newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2792,7 +2792,7 @@ namespace Axivion::Internal::Dto
void setTypeEnum(std::optional<NamedFilterType> newValue); void setTypeEnum(std::optional<NamedFilterType> newValue);
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2854,7 +2854,7 @@ namespace Axivion::Internal::Dto
std::optional<NamedFilterVisibilityDto> visibility std::optional<NamedFilterVisibilityDto> visibility
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2916,7 +2916,7 @@ namespace Axivion::Internal::Dto
bool hasHiddenIssues bool hasHiddenIssues
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -2953,7 +2953,7 @@ namespace Axivion::Internal::Dto
bool hasWarnings bool hasWarnings
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
/** /**
@@ -3023,7 +3023,7 @@ namespace Axivion::Internal::Dto
QString axivionDefaultFilter QString axivionDefaultFilter
); );
virtual QByteArray serialize() const override; QByteArray serialize() const override;
}; };
} }

View File

@@ -44,8 +44,8 @@ public:
ConfigureEnvironmentAspect(Utils::AspectContainer *container, ConfigureEnvironmentAspect(Utils::AspectContainer *container,
ProjectExplorer::BuildConfiguration *buildConfig); ProjectExplorer::BuildConfiguration *buildConfig);
void fromMap(const Utils::Store &map); void fromMap(const Utils::Store &map) override;
void toMap(Utils::Store &map) const; void toMap(Utils::Store &map) const override;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -18,7 +18,7 @@ class ConanPlugin final : public ExtensionSystem::IPlugin
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Conan.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Conan.json")
void initialize() void initialize() override
{ {
d = std::make_unique<ConanPluginPrivate>(); d = std::make_unique<ConanPluginPrivate>();
} }

View File

@@ -1270,8 +1270,8 @@ public:
m_settings->overrideReplacement = QLatin1String("override"); m_settings->overrideReplacement = QLatin1String("override");
} }
bool gather() { return true; } bool gather() override { return true; }
void saveSettings() { } void saveSettings() override { }
}; };
void InsertVirtualMethodsTest::test_data() void InsertVirtualMethodsTest::test_data()

View File

@@ -268,7 +268,7 @@ public:
AddIncludeForUndefinedIdentifierTestFactory(const QString &include) AddIncludeForUndefinedIdentifierTestFactory(const QString &include)
: m_include(include) {} : m_include(include) {}
void match(const CppQuickFixInterface &cppQuickFixInterface, QuickFixOperations &result) void match(const CppQuickFixInterface &cppQuickFixInterface, QuickFixOperations &result) override
{ {
result << new AddIncludeForUndefinedIdentifierOp(cppQuickFixInterface, 0, m_include); result << new AddIncludeForUndefinedIdentifierOp(cppQuickFixInterface, 0, m_include);
} }
@@ -283,7 +283,7 @@ public:
AddForwardDeclForUndefinedIdentifierTestFactory(const QString &className, int symbolPos) AddForwardDeclForUndefinedIdentifierTestFactory(const QString &className, int symbolPos)
: m_className(className), m_symbolPos(symbolPos) {} : m_className(className), m_symbolPos(symbolPos) {}
void match(const CppQuickFixInterface &cppQuickFixInterface, QuickFixOperations &result) void match(const CppQuickFixInterface &cppQuickFixInterface, QuickFixOperations &result) override
{ {
result << new AddForwardDeclForUndefinedIdentifierOp(cppQuickFixInterface, 0, result << new AddForwardDeclForUndefinedIdentifierOp(cppQuickFixInterface, 0,
m_className, m_symbolPos); m_className, m_symbolPos);

View File

@@ -292,7 +292,7 @@ class NoOpTokenAction : public TestActionsTestCase::AbstractAction
{ {
public: public:
/// Do nothing on each token /// Do nothing on each token
void run(CppEditorWidget *) {} void run(CppEditorWidget *) override {}
}; };
class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractAction class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractAction
@@ -300,7 +300,7 @@ class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA
public: public:
/// Follow symbol under cursor /// Follow symbol under cursor
/// Warning: May block if file does not exist (e.g. a not generated ui_* file). /// Warning: May block if file does not exist (e.g. a not generated ui_* file).
void run(CppEditorWidget *editorWidget); void run(CppEditorWidget *editorWidget) override;
}; };
void FollowSymbolUnderCursorTokenAction::run(CppEditorWidget *editorWidget) void FollowSymbolUnderCursorTokenAction::run(CppEditorWidget *editorWidget)
@@ -326,7 +326,7 @@ class SwitchDeclarationDefinitionTokenAction : public TestActionsTestCase::Abstr
{ {
public: public:
/// Switch Declaration/Definition on each token /// Switch Declaration/Definition on each token
void run(CppEditorWidget *); void run(CppEditorWidget *) override;
}; };
void SwitchDeclarationDefinitionTokenAction::run(CppEditorWidget *) void SwitchDeclarationDefinitionTokenAction::run(CppEditorWidget *)
@@ -351,7 +351,7 @@ class FindUsagesTokenAction : public TestActionsTestCase::AbstractAction
{ {
public: public:
/// Find Usages on each token /// Find Usages on each token
void run(CppEditorWidget *editor); void run(CppEditorWidget *editor) override;
}; };
void FindUsagesTokenAction::run(CppEditorWidget *editor) void FindUsagesTokenAction::run(CppEditorWidget *editor)
@@ -364,7 +364,7 @@ class RenameSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA
{ {
public: public:
/// Rename Symbol Under Cursor on each token (Renaming is not applied) /// Rename Symbol Under Cursor on each token (Renaming is not applied)
void run(CppEditorWidget *); void run(CppEditorWidget *) override;
}; };
void RenameSymbolUnderCursorTokenAction::run(CppEditorWidget *) void RenameSymbolUnderCursorTokenAction::run(CppEditorWidget *)
@@ -377,7 +377,7 @@ class OpenTypeHierarchyTokenAction : public TestActionsTestCase::AbstractAction
{ {
public: public:
/// Open Type Hierarchy on each token /// Open Type Hierarchy on each token
void run(CppEditorWidget *); void run(CppEditorWidget *) override;
}; };
void OpenTypeHierarchyTokenAction::run(CppEditorWidget *) void OpenTypeHierarchyTokenAction::run(CppEditorWidget *)
@@ -391,7 +391,7 @@ class InvokeCompletionTokenAction : public TestActionsTestCase::AbstractAction
public: public:
/// Invoke completion menu on each token. /// Invoke completion menu on each token.
/// Warning: May create tool tip artefacts if focus is lost. /// Warning: May create tool tip artefacts if focus is lost.
void run(CppEditorWidget *editorWidget); void run(CppEditorWidget *editorWidget) override;
}; };
void InvokeCompletionTokenAction::run(CppEditorWidget *editorWidget) void InvokeCompletionTokenAction::run(CppEditorWidget *editorWidget)
@@ -417,7 +417,7 @@ class RunAllQuickFixesTokenAction : public TestActionsTestCase::AbstractAction
{ {
public: public:
/// Trigger all Quick Fixes and apply the matching ones /// Trigger all Quick Fixes and apply the matching ones
void run(CppEditorWidget *editorWidget); void run(CppEditorWidget *editorWidget) override;
}; };
// TODO: Some QuickFixes operate on selections. // TODO: Some QuickFixes operate on selections.
@@ -456,7 +456,7 @@ void RunAllQuickFixesTokenAction::run(CppEditorWidget *editorWidget)
class SwitchHeaderSourceFileAction : public TestActionsTestCase::AbstractAction class SwitchHeaderSourceFileAction : public TestActionsTestCase::AbstractAction
{ {
public: public:
void run(CppEditorWidget *); void run(CppEditorWidget *) override;
}; };
void SwitchHeaderSourceFileAction::run(CppEditorWidget *) void SwitchHeaderSourceFileAction::run(CppEditorWidget *)

View File

@@ -116,7 +116,7 @@ private:
{settings().dockerBinaryPath(), {"container", "start", "-i", "-a", m_containerId}}); {settings().dockerBinaryPath(), {"container", "start", "-i", "-a", m_containerId}});
} }
CommandLine createFallbackCommand(const CommandLine &cmdLine) CommandLine createFallbackCommand(const CommandLine &cmdLine) override
{ {
CommandLine result = cmdLine; CommandLine result = cmdLine;
result.setExecutable(m_devicePath.withNewPath(cmdLine.executable().path())); result.setExecutable(m_devicePath.withNewPath(cmdLine.executable().path()));

View File

@@ -840,7 +840,7 @@ class FossilLogHighlighter : QSyntaxHighlighter
{ {
public: public:
explicit FossilLogHighlighter(QTextDocument *parent); explicit FossilLogHighlighter(QTextDocument *parent);
virtual void highlightBlock(const QString &text) final; void highlightBlock(const QString &text) final;
private: private:
const QRegularExpression m_revisionIdRx; const QRegularExpression m_revisionIdRx;

View File

@@ -21,7 +21,7 @@ class IncrediBuildPlugin final : public ExtensionSystem::IPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "IncrediBuild.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "IncrediBuild.json")
public: public:
void initialize() void initialize() override
{ {
d = std::make_unique<IncrediBuildPluginPrivate>(); d = std::make_unique<IncrediBuildPluginPrivate>();
} }

View File

@@ -131,7 +131,7 @@ public:
m_settings.reset(LanguageClientManager::currentSettings()); m_settings.reset(LanguageClientManager::currentSettings());
resetCurrentSettings(row); resetCurrentSettings(row);
} }
void finish() void finish() override
{ {
m_settings.reset(LanguageClientManager::currentSettings()); m_settings.reset(LanguageClientManager::currentSettings());
m_changedSettings.clear(); m_changedSettings.clear();

View File

@@ -20,10 +20,10 @@ public:
~McuSupportImportProvider() {} ~McuSupportImportProvider() {}
// Overridden functions // Overridden functions
virtual QList<Import> imports(ValueOwner *valueOwner, QList<Import> imports(ValueOwner *valueOwner,
const Document *context, const Document *context,
Snapshot *snapshot) const override; Snapshot *snapshot) const override;
virtual void loadBuiltins(ImportsPerDocument *importsPerDocument, void loadBuiltins(ImportsPerDocument *importsPerDocument,
Imports *imports, Imports *imports,
const Document *context, const Document *context,
ValueOwner *valueOwner, ValueOwner *valueOwner,

View File

@@ -188,7 +188,7 @@ struct ArrayBuildOption : BuildOption
} }
Type type() const override { return Type::array; } Type type() const override { return Type::array; }
BuildOption *copy() const override { return new ArrayBuildOption{*this}; } BuildOption *copy() const override { return new ArrayBuildOption{*this}; }
inline virtual QString mesonArg() const override inline QString mesonArg() const override
{ {
return QString("-D%1=[%2]").arg(fullName()).arg(quoteAll(m_currentValue).join(',')); return QString("-D%1=[%2]").arg(fullName()).arg(quoteAll(m_currentValue).join(','));
} }

View File

@@ -63,12 +63,12 @@ public:
setup(k); setup(k);
} }
KitAspect *createKitAspect(Kit *k) const KitAspect *createKitAspect(Kit *k) const override
{ {
return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson}; return new ToolKitAspectWidget{k, this, ToolKitAspectWidget::ToolType::Meson};
} }
ItemList toUserOutput( const Kit *k) const ItemList toUserOutput(const Kit *k) const override
{ {
const auto tool = MesonToolKitAspect::mesonTool(k); const auto tool = MesonToolKitAspect::mesonTool(k);
if (tool) if (tool)

View File

@@ -64,7 +64,7 @@ public:
setup(k); setup(k);
} }
ItemList toUserOutput( const Kit *k) const ItemList toUserOutput(const Kit *k) const override
{ {
const auto tool = NinjaToolKitAspect::ninjaTool(k); const auto tool = NinjaToolKitAspect::ninjaTool(k);
if (tool) if (tool)

View File

@@ -15,7 +15,7 @@ public:
protected: protected:
void findLinkAt(const QTextCursor &, const Utils::LinkHandler &processLinkCallback, void findLinkAt(const QTextCursor &, const Utils::LinkHandler &processLinkCallback,
bool resolveTarget, bool inNextSplit); bool resolveTarget, bool inNextSplit) override;
private: private:
void onFindLinkFinished(Suggest::NimSuggestClientRequest *request); void onFindLinkFinished(Suggest::NimSuggestClientRequest *request);

View File

@@ -45,9 +45,9 @@ public:
bool hasError() const { return m_hasError; } bool hasError() const { return m_hasError; }
// Note: Make sure subclasses call the superclasses' fromMap() function! // Note: Make sure subclasses call the superclasses' fromMap() function!
virtual void fromMap(const Utils::Store &map) override; void fromMap(const Utils::Store &map) override;
// Note: Make sure subclasses call the superclasses' toMap() function! // Note: Make sure subclasses call the superclasses' toMap() function!
virtual void toMap(Utils::Store &map) const override; void toMap(Utils::Store &map) const override;
Target *target() const; Target *target() const;
Project *project() const; Project *project() const;

View File

@@ -143,7 +143,7 @@ public:
// Used by the toolchainmanager to save user-generated tool chains. // Used by the toolchainmanager to save user-generated tool chains.
// Make sure to call this function when deriving! // Make sure to call this function when deriving!
virtual void toMap(Utils::Store &map) const; void toMap(Utils::Store &map) const override;
virtual Tasks validateKit(const Kit *k) const; virtual Tasks validateKit(const Kit *k) const;
virtual bool isJobCountSupported() const { return true; } virtual bool isJobCountSupported() const { return true; }
@@ -180,7 +180,7 @@ protected:
void toolChainUpdated(); void toolChainUpdated();
// Make sure to call this function when deriving! // Make sure to call this function when deriving!
virtual void fromMap(const Utils::Store &data); void fromMap(const Utils::Store &data) override;
void reportError(); void reportError();
bool hasError() const; bool hasError() const;

View File

@@ -62,7 +62,7 @@ public:
private: private:
void makeReadOnly() final { m_combo->setEnabled(false); } void makeReadOnly() final { m_combo->setEnabled(false); }
void addToLayoutImpl(Layouting::LayoutItem &parent) void addToLayoutImpl(Layouting::LayoutItem &parent) override
{ {
addMutableAction(m_combo); addMutableAction(m_combo);
parent.addItem(m_combo); parent.addItem(m_combo);

View File

@@ -26,7 +26,7 @@ public:
const Valgrind::Callgrind::Function *function() const; const Valgrind::Callgrind::Function *function() const;
private: private:
bool addToolTipContent(QLayout *target) const; bool addToolTipContent(QLayout *target) const override;
qreal costs() const; qreal costs() const;
QPersistentModelIndex m_modelIndex; QPersistentModelIndex m_modelIndex;

View File

@@ -36,7 +36,7 @@ public:
#endif #endif
} }
virtual void extensionsInitialized() final { settings().setVcpkgRootEnvironmentVariable(); } void extensionsInitialized() final { settings().setVcpkgRootEnvironmentVariable(); }
std::unique_ptr<VcpkgPluginPrivate> d; std::unique_ptr<VcpkgPluginPrivate> d;
}; };

View File

@@ -84,7 +84,7 @@ signals:
void submitActionEnabledChanged(bool); void submitActionEnabledChanged(bool);
protected: protected:
virtual void changeEvent(QEvent *event) override; void changeEvent(QEvent *event) override;
virtual QString cleanupDescription(const QString &) const; virtual QString cleanupDescription(const QString &) const;
virtual QString commitName() const; virtual QString commitName() const;
void insertTopWidget(QWidget *w); void insertTopWidget(QWidget *w);

View File

@@ -72,7 +72,7 @@ class ResizeSignallingWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event) override;
signals: signals:
void resized(const QSize &size, const QSize &oldSize); void resized(const QSize &size, const QSize &oldSize);

View File

@@ -68,10 +68,10 @@ public:
: errorCount(0) : errorCount(0)
{ } { }
virtual void report(int /*level*/, void report(int /*level*/,
const StringLiteral *fileName, const StringLiteral *fileName,
int line, int column, int line, int column,
const char *format, va_list ap) const char *format, va_list ap) override
{ {
++errorCount; ++errorCount;

View File

@@ -51,10 +51,10 @@ class tst_c99: public QObject
{ {
} }
virtual void report(int level, void report(int level,
const StringLiteral *fileName, const StringLiteral *fileName,
int line, int column, int line, int column,
const char *format, va_list ap) const char *format, va_list ap) override
{ {
if (! errors) if (! errors)
return; return;

View File

@@ -54,7 +54,7 @@ class tst_cxx11: public QObject
{ {
} }
virtual void report(int level, void report(int level,
const StringLiteral *fileName, const StringLiteral *fileName,
int line, int column, int line, int column,
const char *format, va_list ap) override const char *format, va_list ap) override
@@ -86,9 +86,9 @@ class tst_cxx11: public QObject
} }
private: private:
bool preVisit(Symbol *) { return !m_function; } bool preVisit(Symbol *) override { return !m_function; }
bool visit(Function *function) bool visit(Function *function) override
{ {
if (function->name()) if (function->name())
return true; return true;

View File

@@ -35,7 +35,7 @@ public:
return _exprs; return _exprs;
} }
virtual bool preVisit(AST *ast) { bool preVisit(AST *ast) override {
if (NameAST *nameAst = ast->asName()) if (NameAST *nameAst = ast->asName())
if (!qstrcmp(_name, nameAst->name->identifier()->chars())) if (!qstrcmp(_name, nameAst->name->identifier()->chars()))
_exprs.append(nameAst); _exprs.append(nameAst);

View File

@@ -45,7 +45,7 @@ public:
{ accept(ast); } { accept(ast); }
protected: protected:
virtual bool visit(ClassSpecifierAST *ast) bool visit(ClassSpecifierAST *ast) override
{ {
Class *classSymbol = ast->symbol; Class *classSymbol = ast->symbol;
Q_ASSERT(classSymbol != 0); Q_ASSERT(classSymbol != 0);

View File

@@ -102,40 +102,42 @@ public:
virtual ~MockClient() {} virtual ~MockClient() {}
virtual void macroAdded(const Macro & macro) void macroAdded(const Macro &macro) override
{ {
m_definedMacros.append(macro.name()); m_definedMacros.append(macro.name());
m_definedMacrosLine.append(macro.line()); m_definedMacrosLine.append(macro.line());
} }
virtual void passedMacroDefinitionCheck(int /*bytesOffset*/, void passedMacroDefinitionCheck(int /*bytesOffset*/,
int /*utf16charsOffset*/, int /*utf16charsOffset*/,
int line, int line,
const Macro &macro) const Macro &macro) override
{ {
m_definitionsResolvedFromLines[macro.name()].append(line); m_definitionsResolvedFromLines[macro.name()].append(line);
} }
virtual void failedMacroDefinitionCheck(int /*offset*/, void failedMacroDefinitionCheck(int /*offset*/,
int /*utf16charsOffset*/, int /*utf16charsOffset*/,
const ByteArrayRef &name) const ByteArrayRef &name) override
{ {
m_unresolvedDefines.insert(name.toByteArray()); m_unresolvedDefines.insert(name.toByteArray());
} }
virtual void notifyMacroReference(int bytesOffset, int /*utf16charsOffset*/, void notifyMacroReference(int bytesOffset,
int line, const Macro &macro) int /*utf16charsOffset*/,
int line,
const Macro &macro) override
{ {
m_macroUsesLine[macro.name()].append(line); m_macroUsesLine[macro.name()].append(line);
m_expandedMacrosOffset.append(bytesOffset); m_expandedMacrosOffset.append(bytesOffset);
} }
virtual void startExpandingMacro(int bytesOffset, void startExpandingMacro(int bytesOffset,
int /*utf16charsOffset*/, int /*utf16charsOffset*/,
int line, int line,
const Macro &macro, const Macro &macro,
const QVector<MacroArgumentReference> &actuals const QVector<MacroArgumentReference> &actuals
= QVector<MacroArgumentReference>()) = QVector<MacroArgumentReference>()) override
{ {
m_expandedMacros.append(macro.name()); m_expandedMacros.append(macro.name());
m_expandedMacrosOffset.append(bytesOffset); m_expandedMacrosOffset.append(bytesOffset);
@@ -144,16 +146,16 @@ public:
m_usedMacros.insert(macro.name(), actuals); m_usedMacros.insert(macro.name(), actuals);
} }
virtual void stopExpandingMacro(int /*offset*/, const Macro &/*macro*/) {} void stopExpandingMacro(int /*offset*/, const Macro &/*macro*/) override {}
virtual void startSkippingBlocks(int utf16charsOffset) void startSkippingBlocks(int utf16charsOffset) override
{ m_skippedBlocks.append(Block(utf16charsOffset)); } { m_skippedBlocks.append(Block(utf16charsOffset)); }
virtual void stopSkippingBlocks(int utf16charsOffset) void stopSkippingBlocks(int utf16charsOffset) override
{ m_skippedBlocks.last().end = utf16charsOffset; } { m_skippedBlocks.last().end = utf16charsOffset; }
virtual void sourceNeeded(int line, const Utils::FilePath &includedFileName, IncludeType mode, void sourceNeeded(int line, const Utils::FilePath &includedFileName, IncludeType mode,
const Utils::FilePaths &initialIncludes = {}) const Utils::FilePaths &initialIncludes = {}) override
{ {
Q_UNUSED(initialIncludes) Q_UNUSED(initialIncludes)
#if 1 #if 1
@@ -223,7 +225,7 @@ public:
*m_output = m_pp.run(fileName, src, nolines, true); *m_output = m_pp.run(fileName, src, nolines, true);
} }
virtual void markAsIncludeGuard(const QByteArray &macroName) void markAsIncludeGuard(const QByteArray &macroName) override
{ m_includeGuardMacro = macroName; } { m_includeGuardMacro = macroName; }
QByteArray includeGuard() const QByteArray includeGuard() const

View File

@@ -90,10 +90,10 @@ public:
: errorCount(0) : errorCount(0)
{ } { }
virtual void report(int /*level*/, void report(int /*level*/,
const StringLiteral *fileName, const StringLiteral *fileName,
int line, int column, int line, int column,
const char *format, va_list ap) const char *format, va_list ap) override
{ {
++errorCount; ++errorCount;
@@ -757,7 +757,7 @@ public:
return selectors; return selectors;
} }
virtual bool visit(ObjCSelectorAST *ast) {selectors.append(ast); return false;} bool visit(ObjCSelectorAST *ast) override {selectors.append(ast); return false;}
private: private:
QList<ObjCSelectorAST *> selectors; QList<ObjCSelectorAST *> selectors;

View File

@@ -109,7 +109,7 @@ private:
Diagnostic() : errorCount(0) {} Diagnostic() : errorCount(0) {}
void report(int /*level*/, const StringLiteral *fileName, int line, void report(int /*level*/, const StringLiteral *fileName, int line,
int column, const char *format, va_list ap) int column, const char *format, va_list ap) override
{ {
++errorCount; ++errorCount;
qDebug() << fileName->chars() << ':' << line << ':' << column qDebug() << fileName->chars() << ':' << line << ':' << column

View File

@@ -26,7 +26,7 @@ class PLUGIN3_EXPORT MyPlugin3 : public ExtensionSystem::IPlugin
public: public:
MyPlugin3(); MyPlugin3();
bool initialize(const QStringList &arguments, QString *errorString); bool initialize(const QStringList &arguments, QString *errorString) override;
}; };
} // namespace Plugin3 } // namespace Plugin3

View File

@@ -18,8 +18,8 @@ class MYPLUGIN_EXPORT MyPluginImpl : public ExtensionSystem::IPlugin
public: public:
MyPluginImpl(); MyPluginImpl();
bool initialize(const QStringList &arguments, QString *errorString); bool initialize(const QStringList &arguments, QString *errorString) override;
void extensionsInitialized(); void extensionsInitialized() override;
public slots: public slots:
bool isInitialized() { return m_isInitialized; } bool isInitialized() { return m_isInitialized; }

View File

@@ -23,7 +23,7 @@ static void print(const QString &fileName, int lineNo, const QString &msg)
class ParseHandler : public QMakeParserHandler { class ParseHandler : public QMakeParserHandler {
public: public:
virtual void message(int /* type */, const QString &msg, const QString &fileName, int lineNo) void message(int /* type */, const QString &msg, const QString &fileName, int lineNo) override
{ print(fileName, lineNo, msg); } { print(fileName, lineNo, msg); }
}; };

View File

@@ -64,7 +64,8 @@ QtMessageHandler MessageHandler::s_oldMessageHandler = 0;
class MacroMapExpander : public AbstractMacroExpander { class MacroMapExpander : public AbstractMacroExpander {
public: public:
virtual bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander*> &seen) bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander*> &seen)
override
{ {
// loop prevention // loop prevention
const int count = seen.count(); const int count = seen.count();

View File

@@ -113,7 +113,7 @@ public:
VersionedBackUpStrategy(accessor) VersionedBackUpStrategy(accessor)
{ } { }
FilePaths readFileCandidates(const Utils::FilePath &baseFileName) const FilePaths readFileCandidates(const Utils::FilePath &baseFileName) const override
{ {
return Utils::filtered(static_cast<const BasicTestSettingsAccessor *>(accessor())->fileNames(), return Utils::filtered(static_cast<const BasicTestSettingsAccessor *>(accessor())->fileNames(),
[&baseFileName](const Utils::FilePath &f) { [&baseFileName](const Utils::FilePath &f) {

View File

@@ -13,7 +13,8 @@ using namespace Utils;
class TestMacroExpander : public Utils::AbstractMacroExpander class TestMacroExpander : public Utils::AbstractMacroExpander
{ {
public: public:
virtual bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander*> &seen) bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander*> &seen)
override
{ {
// loop prevention // loop prevention
const int count = seen.count(); const int count = seen.count();

View File

@@ -30,7 +30,7 @@ class TestDFA : public UnixDeviceFileAccess
public: public:
using UnixDeviceFileAccess::UnixDeviceFileAccess; using UnixDeviceFileAccess::UnixDeviceFileAccess;
virtual RunResult runInShell(const CommandLine &cmdLine, RunResult runInShell(const CommandLine &cmdLine,
const QByteArray &inputData = {}) const override const QByteArray &inputData = {}) const override
{ {
// Note: Don't convert into Utils::Process. See more comments in this change in gerrit. // Note: Don't convert into Utils::Process. See more comments in this change in gerrit.

View File

@@ -172,7 +172,7 @@ class MyThread : public QThread {
public: public:
MyThread(int base, QObject *parent) : QThread(parent), m_base(base) {} MyThread(int base, QObject *parent) : QThread(parent), m_base(base) {}
void run(); void run() override;
private: private:
int m_base; int m_base;
}; };
@@ -196,7 +196,7 @@ void MyThread::run()
class MyFastThread : public QThread { class MyFastThread : public QThread {
public: public:
MyFastThread(QObject *parent) : QThread(parent) {} MyFastThread(QObject *parent) : QThread(parent) {}
void run() { qDebug() << "Done" << currentThreadId(); } void run() override { qDebug() << "Done" << currentThreadId(); }
}; };

View File

@@ -314,7 +314,7 @@ struct BaseClass
struct DerivedClass : BaseClass struct DerivedClass : BaseClass
{ {
DerivedClass() : b(2) {} DerivedClass() : b(2) {}
int foo() { return b; } int foo() override { return b; }
int b; int b;
}; };
@@ -4204,7 +4204,7 @@ namespace qthread {
void setId(int id) { m_id = id; } void setId(int id) { m_id = id; }
void run() void run() override
{ {
int j = 2; int j = 2;
++j; ++j;
@@ -4787,7 +4787,7 @@ namespace namespc {
{ {
public: public:
MyFoo() {} MyFoo() {}
virtual void doit(int i) void doit(int i) override
{ {
// Note there's a local 'n' and one in the base class. // Note there's a local 'n' and one in the base class.
n = i; n = i;
@@ -4799,7 +4799,7 @@ namespace namespc {
class MyBar : public MyFoo class MyBar : public MyFoo
{ {
public: public:
virtual void doit(int i) void doit(int i) override
{ {
n = i + 1; n = i + 1;
} }
@@ -4810,7 +4810,7 @@ namespace namespc {
class MyAnon : public MyBar class MyAnon : public MyBar
{ {
public: public:
virtual void doit(int i) void doit(int i) override
{ {
n = i + 3; n = i + 3;
} }
@@ -4821,7 +4821,7 @@ namespace namespc {
class MyBaz : public MyAnon class MyBaz : public MyAnon
{ {
public: public:
virtual void doit(int i) void doit(int i) override
{ {
n = i + 5; n = i + 5;
} }
@@ -6549,7 +6549,7 @@ namespace bug5106 {
{ {
public: public:
B5106(int c, int a, int b) : A5106(a, b), m_c(c) {Q_UNUSED(m_c)} B5106(int c, int a, int b) : A5106(a, b), m_c(c) {Q_UNUSED(m_c)}
virtual int test() { return 4; BREAK_HERE; } int test() override { return 4; BREAK_HERE; }
private: private:
int m_c; int m_c;
}; };

View File

@@ -28,7 +28,7 @@ public:
TextEdit::setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); TextEdit::setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
} }
void paintEvent(QPaintEvent *e) void paintEvent(QPaintEvent *e) override
{ {
TextEdit::paintEvent(e); TextEdit::paintEvent(e);

View File

@@ -31,14 +31,14 @@ static void print(const QString &fileName, int lineNo, int type, const QString &
class EvalHandler : public QMakeHandler { class EvalHandler : public QMakeHandler {
public: public:
virtual void message(int type, const QString &msg, const QString &fileName, int lineNo) void message(int type, const QString &msg, const QString &fileName, int lineNo) override
{ print(fileName, lineNo, type, msg); } { print(fileName, lineNo, type, msg); }
virtual void fileMessage(int /*type*/, const QString &msg) void fileMessage(int /*type*/, const QString &msg) override
{ qWarning("%s", qPrintable(msg)); } { qWarning("%s", qPrintable(msg)); }
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {} void aboutToEval(ProFile *, ProFile *, EvalFileType) override {}
virtual void doneWithEval(ProFile *) {} void doneWithEval(ProFile *) override {}
}; };
static EvalHandler evalHandler; static EvalHandler evalHandler;