forked from qt-creator/qt-creator
Prefer using 'override' instead of 'virtual'
warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] Change-Id: I6dac7a62b627fa1353b4455e1af92f869c2571cc Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -46,9 +46,9 @@ public:
|
||||
, m_snapshot(snapshot)
|
||||
{}
|
||||
|
||||
virtual void indentSelection(const QTextCursor &selection,
|
||||
const QString &fileName,
|
||||
const TextEditor::TextDocument *textDocument) const
|
||||
void indentSelection(const QTextCursor &selection,
|
||||
const QString &fileName,
|
||||
const TextEditor::TextDocument *textDocument) const override
|
||||
{
|
||||
// ### shares code with QmlJSTextEditor::indent
|
||||
QTextDocument *doc = selection.document();
|
||||
@@ -70,9 +70,9 @@ public:
|
||||
} while (block.isValid() && block != end);
|
||||
}
|
||||
|
||||
virtual void reindentSelection(const QTextCursor &selection,
|
||||
const QString &fileName,
|
||||
const TextEditor::TextDocument *textDocument) const
|
||||
void reindentSelection(const QTextCursor &selection,
|
||||
const QString &fileName,
|
||||
const TextEditor::TextDocument *textDocument) const override
|
||||
{
|
||||
const TextEditor::TabSettings &tabSettings =
|
||||
ProjectExplorer::actualTabSettings(fileName, textDocument);
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
indenter.reindent(selection.document(), selection, tabSettings);
|
||||
}
|
||||
|
||||
virtual void fileChanged(const QString &fileName)
|
||||
void fileChanged(const QString &fileName) override
|
||||
{
|
||||
m_modelManager->updateSourceFiles(QStringList(fileName), true);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ protected:
|
||||
return handle(ast, ast->firstSourceLocation(), ast->lastSourceLocation(), addToPath);
|
||||
}
|
||||
|
||||
virtual bool preVisit(AST::Node *node)
|
||||
bool preVisit(AST::Node *node) override
|
||||
{
|
||||
if (Statement *stmt = node->statementCast())
|
||||
return handleLocationAst(stmt);
|
||||
@@ -97,7 +97,7 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visit(AST::UiQualifiedId *ast)
|
||||
bool visit(AST::UiQualifiedId *ast) override
|
||||
{
|
||||
AST::SourceLocation first = ast->identifierToken;
|
||||
AST::SourceLocation last;
|
||||
@@ -108,19 +108,19 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool visit(AST::UiProgram *ast)
|
||||
bool visit(AST::UiProgram *ast) override
|
||||
{
|
||||
_path.append(ast);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visit(AST::Program *ast)
|
||||
bool visit(AST::Program *ast) override
|
||||
{
|
||||
_path.append(ast);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visit(AST::UiImport *ast)
|
||||
bool visit(AST::UiImport *ast) override
|
||||
{
|
||||
return handleLocationAst(ast);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user