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>
{
private:
void start() {
void start() override {
connect(task(), &QProcess::finished, this, [this] {
const bool success = task()->exitStatus() == QProcess::NormalExit
&& task()->error() == QProcess::UnknownError

View File

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

View File

@@ -202,7 +202,7 @@ public:
class DefaultImpl : public ProcessInterface
{
private:
virtual void start() final;
void start() final;
virtual void doDefaultStart(const QString &program, const QStringList &arguments) = 0;
bool dissolveCommand(QString *program, QStringList *arguments);
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
{
@@ -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
{

View File

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

View File

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

View File

@@ -24,7 +24,7 @@ public:
virtual ~TransientScrollAreaSupport();
protected:
virtual bool eventFilter(QObject *watched, QEvent *event) override;
bool eventFilter(QObject *watched, QEvent *event) override;
private:
explicit TransientScrollAreaSupport(QAbstractScrollArea *scrollArea);
@@ -66,6 +66,6 @@ public:
private:
GlobalTransientSupport();
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;
void setBuildKey(const QString &buildKey);
void accept();
void accept() override;
bool copyGradle();
void setDirectory(const Utils::FilePath &directory);

View File

@@ -124,7 +124,7 @@ public:
explicit TestToolConfiguration(ITestBase *testBase) : ITestConfiguration(testBase) {}
Utils::CommandLine commandLine() const { return m_commandLine; }
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:
Utils::CommandLine m_commandLine;

View File

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

View File

@@ -126,7 +126,7 @@ namespace Axivion::Internal::Dto
// Throws std::bad_variant_access
const bool &getBool() const;
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
private:
std::variant<
@@ -179,7 +179,7 @@ namespace Axivion::Internal::Dto
std::optional<QString> languageName
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -252,7 +252,7 @@ namespace Axivion::Internal::Dto
QString newPassword
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -292,7 +292,7 @@ namespace Axivion::Internal::Dto
QString displayColor
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -314,7 +314,7 @@ namespace Axivion::Internal::Dto
QString text
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -342,7 +342,7 @@ namespace Axivion::Internal::Dto
QString csrfToken
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -389,7 +389,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -577,7 +577,7 @@ namespace Axivion::Internal::Dto
std::optional<QString> commentDeletionId
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -723,7 +723,7 @@ namespace Axivion::Internal::Dto
qint32 endColumn
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -754,7 +754,7 @@ namespace Axivion::Internal::Dto
QString color
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -814,7 +814,7 @@ namespace Axivion::Internal::Dto
std::optional<bool> selected
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -898,7 +898,7 @@ namespace Axivion::Internal::Dto
Any maxValue
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -960,7 +960,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1048,7 +1048,7 @@ namespace Axivion::Internal::Dto
QString url
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1087,7 +1087,7 @@ namespace Axivion::Internal::Dto
std::optional<bool> disabled
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1178,7 +1178,7 @@ namespace Axivion::Internal::Dto
QString buildDate
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1244,7 +1244,7 @@ namespace Axivion::Internal::Dto
qint32 Removed
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1358,7 +1358,7 @@ namespace Axivion::Internal::Dto
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);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1557,7 +1557,7 @@ namespace Axivion::Internal::Dto
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);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1816,7 +1816,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -1885,7 +1885,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2022,7 +2022,7 @@ namespace Axivion::Internal::Dto
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);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2087,7 +2087,7 @@ namespace Axivion::Internal::Dto
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);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2185,7 +2185,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2241,7 +2241,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2372,7 +2372,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2498,7 +2498,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2582,7 +2582,7 @@ namespace Axivion::Internal::Dto
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);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2792,7 +2792,7 @@ namespace Axivion::Internal::Dto
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
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2916,7 +2916,7 @@ namespace Axivion::Internal::Dto
bool hasHiddenIssues
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -2953,7 +2953,7 @@ namespace Axivion::Internal::Dto
bool hasWarnings
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
/**
@@ -3023,7 +3023,7 @@ namespace Axivion::Internal::Dto
QString axivionDefaultFilter
);
virtual QByteArray serialize() const override;
QByteArray serialize() const override;
};
}

View File

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

View File

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

View File

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

View File

@@ -268,7 +268,7 @@ public:
AddIncludeForUndefinedIdentifierTestFactory(const QString &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);
}
@@ -283,7 +283,7 @@ public:
AddForwardDeclForUndefinedIdentifierTestFactory(const QString &className, int 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,
m_className, m_symbolPos);

View File

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

View File

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

View File

@@ -840,7 +840,7 @@ class FossilLogHighlighter : QSyntaxHighlighter
{
public:
explicit FossilLogHighlighter(QTextDocument *parent);
virtual void highlightBlock(const QString &text) final;
void highlightBlock(const QString &text) final;
private:
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")
public:
void initialize()
void initialize() override
{
d = std::make_unique<IncrediBuildPluginPrivate>();
}

View File

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

View File

@@ -20,14 +20,14 @@ public:
~McuSupportImportProvider() {}
// Overridden functions
virtual QList<Import> imports(ValueOwner *valueOwner,
const Document *context,
Snapshot *snapshot) const override;
virtual void loadBuiltins(ImportsPerDocument *importsPerDocument,
Imports *imports,
const Document *context,
ValueOwner *valueOwner,
Snapshot *snapshot) override;
QList<Import> imports(ValueOwner *valueOwner,
const Document *context,
Snapshot *snapshot) const override;
void loadBuiltins(ImportsPerDocument *importsPerDocument,
Imports *imports,
const Document *context,
ValueOwner *valueOwner,
Snapshot *snapshot) override;
// Add to the interfaces needed for a document
// path: opened qml document

View File

@@ -188,7 +188,7 @@ struct ArrayBuildOption : BuildOption
}
Type type() const override { return Type::array; }
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(','));
}

View File

@@ -63,12 +63,12 @@ public:
setup(k);
}
KitAspect *createKitAspect(Kit *k) const
KitAspect *createKitAspect(Kit *k) const override
{
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);
if (tool)

View File

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

View File

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

View File

@@ -45,9 +45,9 @@ public:
bool hasError() const { return m_hasError; }
// 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!
virtual void toMap(Utils::Store &map) const override;
void toMap(Utils::Store &map) const override;
Target *target() const;
Project *project() const;

View File

@@ -143,7 +143,7 @@ public:
// Used by the toolchainmanager to save user-generated tool chains.
// 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 bool isJobCountSupported() const { return true; }
@@ -180,7 +180,7 @@ protected:
void toolChainUpdated();
// Make sure to call this function when deriving!
virtual void fromMap(const Utils::Store &data);
void fromMap(const Utils::Store &data) override;
void reportError();
bool hasError() const;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -54,10 +54,10 @@ class tst_cxx11: public QObject
{
}
virtual void report(int level,
const StringLiteral *fileName,
int line, int column,
const char *format, va_list ap) override
void report(int level,
const StringLiteral *fileName,
int line, int column,
const char *format, va_list ap) override
{
if (! errors)
return;
@@ -86,9 +86,9 @@ class tst_cxx11: public QObject
}
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())
return true;

View File

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

View File

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

View File

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

View File

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

View File

@@ -109,7 +109,7 @@ private:
Diagnostic() : errorCount(0) {}
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;
qDebug() << fileName->chars() << ':' << line << ':' << column

View File

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

View File

@@ -18,8 +18,8 @@ class MYPLUGIN_EXPORT MyPluginImpl : public ExtensionSystem::IPlugin
public:
MyPluginImpl();
bool initialize(const QStringList &arguments, QString *errorString);
void extensionsInitialized();
bool initialize(const QStringList &arguments, QString *errorString) override;
void extensionsInitialized() override;
public slots:
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 {
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); }
};

View File

@@ -64,7 +64,8 @@ QtMessageHandler MessageHandler::s_oldMessageHandler = 0;
class MacroMapExpander : public AbstractMacroExpander {
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
const int count = seen.count();

View File

@@ -113,7 +113,7 @@ public:
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(),
[&baseFileName](const Utils::FilePath &f) {

View File

@@ -13,7 +13,8 @@ using namespace Utils;
class TestMacroExpander : public Utils::AbstractMacroExpander
{
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
const int count = seen.count();

View File

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

View File

@@ -172,7 +172,7 @@ class MyThread : public QThread {
public:
MyThread(int base, QObject *parent) : QThread(parent), m_base(base) {}
void run();
void run() override;
private:
int m_base;
};
@@ -196,7 +196,7 @@ void MyThread::run()
class MyFastThread : public QThread {
public:
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
{
DerivedClass() : b(2) {}
int foo() { return b; }
int foo() override { return b; }
int b;
};
@@ -4204,7 +4204,7 @@ namespace qthread {
void setId(int id) { m_id = id; }
void run()
void run() override
{
int j = 2;
++j;
@@ -4787,7 +4787,7 @@ namespace namespc {
{
public:
MyFoo() {}
virtual void doit(int i)
void doit(int i) override
{
// Note there's a local 'n' and one in the base class.
n = i;
@@ -4799,7 +4799,7 @@ namespace namespc {
class MyBar : public MyFoo
{
public:
virtual void doit(int i)
void doit(int i) override
{
n = i + 1;
}
@@ -4810,7 +4810,7 @@ namespace namespc {
class MyAnon : public MyBar
{
public:
virtual void doit(int i)
void doit(int i) override
{
n = i + 3;
}
@@ -4821,7 +4821,7 @@ namespace namespc {
class MyBaz : public MyAnon
{
public:
virtual void doit(int i)
void doit(int i) override
{
n = i + 5;
}
@@ -6549,7 +6549,7 @@ namespace bug5106 {
{
public:
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:
int m_c;
};

View File

@@ -28,7 +28,7 @@ public:
TextEdit::setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
void paintEvent(QPaintEvent *e)
void paintEvent(QPaintEvent *e) override
{
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 {
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); }
virtual void fileMessage(int /*type*/, const QString &msg)
void fileMessage(int /*type*/, const QString &msg) override
{ qWarning("%s", qPrintable(msg)); }
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
virtual void doneWithEval(ProFile *) {}
void aboutToEval(ProFile *, ProFile *, EvalFileType) override {}
void doneWithEval(ProFile *) override {}
};
static EvalHandler evalHandler;