From abd97626ac2d50e54650a7256b48b7bbc1b2769e Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 5 Mar 2021 10:01:42 +0200 Subject: Cppcheck: Add explicit and override keywords Change-Id: Ia8305652afdf29cbc88328b76f5156187aa54dba Reviewed-by: Arttu Tarkiainen --- tests/auto/installer/binaryformat/tst_binaryformat.cpp | 4 ++-- tests/auto/installer/factory/tst_factory.cpp | 8 ++++---- .../auto/installer/packagemanagercore/tst_packagemanagercore.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/auto/installer/binaryformat/tst_binaryformat.cpp b/tests/auto/installer/binaryformat/tst_binaryformat.cpp index c9cd2b00f..7e0f5ed24 100644 --- a/tests/auto/installer/binaryformat/tst_binaryformat.cpp +++ b/tests/auto/installer/binaryformat/tst_binaryformat.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -51,7 +51,7 @@ struct Layout : public QInstaller::BinaryLayout class TestOperation : public KDUpdater::UpdateOperation { public: - TestOperation(const QString &name) + explicit TestOperation(const QString &name) : KDUpdater::UpdateOperation(nullptr) { setName(name); } diff --git a/tests/auto/installer/factory/tst_factory.cpp b/tests/auto/installer/factory/tst_factory.cpp index f44a6febe..eb7e2c36c 100644 --- a/tests/auto/installer/factory/tst_factory.cpp +++ b/tests/auto/installer/factory/tst_factory.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -82,7 +82,7 @@ public: : Food(amount) , m_expireDate(expireDate) { qDebug().nospace().noquote() << "Constructor."; } - QDate expireDate() const { + QDate expireDate() const Q_DECL_OVERRIDE { return m_expireDate; } private: @@ -92,7 +92,7 @@ private: class Butter : public Food { public: - QDate expireDate() const { + QDate expireDate() const Q_DECL_OVERRIDE { return m_expireDate; } static Food *create(int amount, const QDate expireDate) { @@ -117,7 +117,7 @@ public: : Food(amount) , m_expireDate(expireDate) { qDebug().nospace().noquote() << "Constructor."; } - QDate expireDate() const { + QDate expireDate() const Q_DECL_OVERRIDE { return m_expireDate; } diff --git a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp index 17343e49d..a3e86c2f8 100644 --- a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp +++ b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -46,7 +46,7 @@ using namespace QInstaller; class DummyComponent : public Component { public: - DummyComponent(PackageManagerCore *core) + explicit DummyComponent(PackageManagerCore *core) : Component(core) { setCheckState(Qt::Checked); -- cgit v1.2.3