forked from qt-creator/qt-creator
AutoTest: Code cosmetics
* use nullptr * override * remove old style casts * fix most of the code model warnings Change-Id: Ia08e846f9326ae28ca7e7d66748e25a8b817b9b1 Reviewed-by: Xing Xiong Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -46,7 +46,7 @@ class AutotestPlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
public:
|
||||
AutotestPlugin();
|
||||
~AutotestPlugin();
|
||||
~AutotestPlugin() override;
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorString) override;
|
||||
void extensionsInitialized() override;
|
||||
|
@@ -54,7 +54,7 @@ namespace Internal {
|
||||
AutoTestUnitTests::AutoTestUnitTests(TestTreeModel *model, QObject *parent)
|
||||
: QObject(parent),
|
||||
m_model(model),
|
||||
m_tmpDir(0),
|
||||
m_tmpDir(nullptr),
|
||||
m_isQt4(false)
|
||||
{
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ class AutoTestUnitTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AutoTestUnitTests(TestTreeModel *model, QObject *parent = 0);
|
||||
explicit AutoTestUnitTests(TestTreeModel *model, QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
|
||||
|
@@ -96,7 +96,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
|
||||
TestResultPtr testResult = TestResultPtr(new GTestResult(m_projectFile));
|
||||
testResult->setResult(Result::MessageDisabledTests);
|
||||
int disabled = disabledTests.cap(1).toInt();
|
||||
testResult->setDescription(tr("You have %n disabled test(s).", 0, disabled));
|
||||
testResult->setDescription(tr("You have %n disabled test(s).", nullptr, disabled));
|
||||
testResult->setLine(disabled); // misuse line property to hold number of disabled
|
||||
reportResult(testResult);
|
||||
m_description.clear();
|
||||
|
@@ -59,7 +59,6 @@ public:
|
||||
|
||||
QWidget *widget() override;
|
||||
void apply() override;
|
||||
void finish() override { }
|
||||
|
||||
private:
|
||||
QSharedPointer<GTestSettings> m_settings;
|
||||
|
@@ -468,7 +468,7 @@ QSet<QString> GTestTreeItem::internalTargets() const
|
||||
const QVector<CppTools::ProjectPart::Ptr> projectParts = projectInfo.projectParts();
|
||||
if (projectParts.isEmpty())
|
||||
return TestTreeItem::dependingInternalTargets(cppMM, file);
|
||||
for (const CppTools::ProjectPart::Ptr projectPart : projectParts) {
|
||||
for (const CppTools::ProjectPart::Ptr &projectPart : projectParts) {
|
||||
if (projectPart->projectFile == proFile()
|
||||
&& Utils::anyOf(projectPart->files, [&file] (const CppTools::ProjectFile &pf) {
|
||||
return pf.path == file;
|
||||
|
@@ -58,7 +58,7 @@ class GTestVisitor : public CPlusPlus::ASTVisitor
|
||||
{
|
||||
public:
|
||||
explicit GTestVisitor(CPlusPlus::Document::Ptr doc);
|
||||
bool visit(CPlusPlus::FunctionDefinitionAST *ast);
|
||||
bool visit(CPlusPlus::FunctionDefinitionAST *ast) override;
|
||||
|
||||
QMap<GTestCaseSpec, GTestCodeLocationList> gtestFunctions() const { return m_gtestFunctions; }
|
||||
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||
}
|
||||
|
||||
virtual ~ITestSettingsPage() {}
|
||||
void finish() override {}
|
||||
|
||||
private:
|
||||
void setId(Core::Id id)
|
||||
|
@@ -47,9 +47,9 @@ static QString decode(const QString& original)
|
||||
while ((pos = regex.indexIn(original, pos)) != -1) {
|
||||
const QString value = regex.cap(1);
|
||||
if (value.startsWith('x'))
|
||||
result.replace(regex.cap(0), QChar(value.midRef(1).toInt(0, 16)));
|
||||
result.replace(regex.cap(0), QChar(value.midRef(1).toInt(nullptr, 16)));
|
||||
else
|
||||
result.replace(regex.cap(0), QChar(value.toInt(0, 10)));
|
||||
result.replace(regex.cap(0), QChar(value.toInt(nullptr, 10)));
|
||||
pos += regex.matchedLength();
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ static QString constructBenchmarkInformation(const QString &metric, double value
|
||||
return QtTestOutputReader::tr("%1 %2 per iteration (total: %3, iterations: %4)")
|
||||
.arg(formatResult(value))
|
||||
.arg(metricsText)
|
||||
.arg(formatResult(value * (double)iterations))
|
||||
.arg(formatResult(value * double(iterations)))
|
||||
.arg(iterations);
|
||||
}
|
||||
|
||||
|
@@ -109,8 +109,8 @@ static QString testClass(const CppTools::CppModelManager *modelManager,
|
||||
const QByteArray name = macro.macro().name();
|
||||
if (QTestUtils::isQTestMacro(name)) {
|
||||
const CPlusPlus::Document::Block arg = macro.arguments().at(0);
|
||||
return QLatin1String(fileContent.mid(arg.bytesBegin(),
|
||||
arg.bytesEnd() - arg.bytesBegin()));
|
||||
return QLatin1String(fileContent.mid(int(arg.bytesBegin()),
|
||||
int(arg.bytesEnd() - arg.bytesBegin())));
|
||||
}
|
||||
}
|
||||
// check if one has used a self-defined macro or QTest::qExec() directly
|
||||
@@ -126,7 +126,8 @@ static CPlusPlus::Document::Ptr declaringDocument(CPlusPlus::Document::Ptr doc,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const QString &testCaseName,
|
||||
const QStringList &alternativeFiles = {},
|
||||
unsigned *line = 0, unsigned *column = 0)
|
||||
unsigned *line = nullptr,
|
||||
unsigned *column = nullptr)
|
||||
{
|
||||
CPlusPlus::Document::Ptr declaringDoc;
|
||||
CPlusPlus::TypeOfExpression typeOfExpr;
|
||||
@@ -152,7 +153,7 @@ static CPlusPlus::Document::Ptr declaringDocument(CPlusPlus::Document::Ptr doc,
|
||||
if (CPlusPlus::Symbol *symbol = item.declaration()) {
|
||||
if (CPlusPlus::Class *toeClass = symbol->asClass()) {
|
||||
const QString declFileName = QLatin1String(toeClass->fileId()->chars(),
|
||||
toeClass->fileId()->size());
|
||||
int(toeClass->fileId()->size()));
|
||||
declaringDoc = snapshot.document(declFileName);
|
||||
if (line)
|
||||
*line = toeClass->line();
|
||||
|
@@ -88,9 +88,8 @@ QString QtTestSettings::metricsTypeToOption(const MetricsType type)
|
||||
return QString("-callgrind");
|
||||
case MetricsType::Perf:
|
||||
return QString("-perf");
|
||||
default:
|
||||
return QString();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -65,8 +65,6 @@ void QtTestSettingsWidget::setSettings(const QtTestSettings &settings)
|
||||
case MetricsType::Perf:
|
||||
m_ui.perfRB->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
m_ui.walltimeRB->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,7 +41,7 @@ class QtTestSettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QtTestSettingsWidget(QWidget *parent = 0);
|
||||
explicit QtTestSettingsWidget(QWidget *parent = nullptr);
|
||||
|
||||
void setSettings(const QtTestSettings &settings);
|
||||
QtTestSettings settings() const;
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
|
||||
QWidget *widget() override;
|
||||
void apply() override;
|
||||
void finish() override { }
|
||||
|
||||
private:
|
||||
QSharedPointer<QtTestSettings> m_settings;
|
||||
|
@@ -167,7 +167,6 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item,
|
||||
testConfigurations << testConfig;
|
||||
return;
|
||||
case Qt::PartiallyChecked:
|
||||
default:
|
||||
QStringList testCases;
|
||||
item->forFirstLevelChildren([&testCases](TestTreeItem *grandChild) {
|
||||
if (grandChild->checked() == Qt::Checked) {
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
QSet<QString> baseClasses() const { return m_baseClasses; }
|
||||
bool resultValid() const { return m_valid; }
|
||||
|
||||
bool visit(CPlusPlus::Class *symbol);
|
||||
bool visit(CPlusPlus::Class *symbol) override;
|
||||
|
||||
private:
|
||||
CppTools::SymbolFinder m_symbolFinder;
|
||||
@@ -67,8 +67,8 @@ class TestAstVisitor : public CPlusPlus::ASTVisitor
|
||||
public:
|
||||
explicit TestAstVisitor(CPlusPlus::Document::Ptr doc, const CPlusPlus::Snapshot &snapshot);
|
||||
|
||||
bool visit(CPlusPlus::CallAST *ast);
|
||||
bool visit(CPlusPlus::CompoundStatementAST *ast);
|
||||
bool visit(CPlusPlus::CallAST *ast) override;
|
||||
bool visit(CPlusPlus::CompoundStatementAST *ast) override;
|
||||
|
||||
QString className() const { return m_className; }
|
||||
|
||||
@@ -84,11 +84,11 @@ class TestDataFunctionVisitor : public CPlusPlus::ASTVisitor
|
||||
public:
|
||||
explicit TestDataFunctionVisitor(CPlusPlus::Document::Ptr doc);
|
||||
|
||||
bool visit(CPlusPlus::UsingDirectiveAST *ast);
|
||||
bool visit(CPlusPlus::FunctionDefinitionAST *ast);
|
||||
bool visit(CPlusPlus::CallAST *ast);
|
||||
bool preVisit(CPlusPlus::AST *ast);
|
||||
void postVisit(CPlusPlus::AST *ast);
|
||||
bool visit(CPlusPlus::UsingDirectiveAST *ast) override;
|
||||
bool visit(CPlusPlus::FunctionDefinitionAST *ast) override;
|
||||
bool visit(CPlusPlus::CallAST *ast) override;
|
||||
bool preVisit(CPlusPlus::AST *ast) override;
|
||||
void postVisit(CPlusPlus::AST *ast) override;
|
||||
QMap<QString, QtTestCodeLocationList> dataTags() const { return m_dataTags; }
|
||||
|
||||
private:
|
||||
|
@@ -120,7 +120,7 @@ static QString quickTestName(const CPlusPlus::Document::Ptr &doc,
|
||||
if (QuickTestUtils::isQuickTestMacro(name)) {
|
||||
CPlusPlus::Document::Block arg = macro.arguments().at(0);
|
||||
return QLatin1String(CppParser::getFileContent(doc->fileName())
|
||||
.mid(arg.bytesBegin(), arg.bytesEnd() - arg.bytesBegin()));
|
||||
.mid(int(arg.bytesBegin()), int(arg.bytesEnd() - arg.bytesBegin())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,10 +311,6 @@ QuickTestParser::QuickTestParser()
|
||||
this, &QuickTestParser::doUpdateWatchPaths, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
QuickTestParser::~QuickTestParser()
|
||||
{
|
||||
}
|
||||
|
||||
void QuickTestParser::init(const QStringList &filesToParse, bool fullParse)
|
||||
{
|
||||
m_qmlSnapshot = QmlJSTools::Internal::ModelManager::instance()->snapshot();
|
||||
|
@@ -46,7 +46,6 @@ class QuickTestParser : public QObject, public CppParser
|
||||
Q_OBJECT
|
||||
public:
|
||||
QuickTestParser();
|
||||
virtual ~QuickTestParser();
|
||||
void init(const QStringList &filesToParse, bool fullParse) override;
|
||||
void release() override;
|
||||
bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
|
||||
|
@@ -416,7 +416,7 @@ QSet<QString> QuickTestTreeItem::internalTargets() const
|
||||
QSet<QString> result;
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto projectInfo = cppMM->projectInfo(ProjectExplorer::SessionManager::startupProject());
|
||||
for (const CppTools::ProjectPart::Ptr projectPart : projectInfo.projectParts()) {
|
||||
for (const CppTools::ProjectPart::Ptr &projectPart : projectInfo.projectParts()) {
|
||||
if (projectPart->buildTargetType != CppTools::ProjectPart::Executable)
|
||||
continue;
|
||||
if (projectPart->projectFile == proFile()) {
|
||||
|
@@ -48,10 +48,6 @@ using namespace ProjectExplorer;
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
TestConfiguration::TestConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
TestConfiguration::~TestConfiguration()
|
||||
{
|
||||
m_testCases.clear();
|
||||
|
@@ -52,7 +52,7 @@ using TestResultPtr = QSharedPointer<TestResult>;
|
||||
class TestConfiguration
|
||||
{
|
||||
public:
|
||||
explicit TestConfiguration();
|
||||
explicit TestConfiguration() = default;
|
||||
virtual ~TestConfiguration();
|
||||
|
||||
void completeTestInformation(TestRunMode runMode);
|
||||
@@ -113,7 +113,6 @@ class DebuggableTestConfiguration : public TestConfiguration
|
||||
public:
|
||||
explicit DebuggableTestConfiguration(TestRunMode runMode = TestRunMode::Run)
|
||||
: m_runMode(runMode) {}
|
||||
~DebuggableTestConfiguration() {}
|
||||
|
||||
void setRunMode(TestRunMode mode) { m_runMode = mode; }
|
||||
TestRunMode runMode() const { return m_runMode; }
|
||||
|
@@ -108,10 +108,6 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
|
||||
m_progressIndicator, &Utils::ProgressIndicator::show);
|
||||
}
|
||||
|
||||
TestNavigationWidget::~TestNavigationWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
const bool enabled = !ProjectExplorer::BuildManager::isBuilding()
|
||||
|
@@ -58,8 +58,7 @@ class TestNavigationWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TestNavigationWidget(QWidget *parent = 0);
|
||||
~TestNavigationWidget();
|
||||
explicit TestNavigationWidget(QWidget *parent = nullptr);
|
||||
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||
QList<QToolButton *> createToolButtons();
|
||||
|
||||
|
@@ -100,7 +100,7 @@ Result::Type TestResult::toResultType(int rt)
|
||||
if (rt < Result::FIRST_TYPE || rt > Result::LAST_TYPE)
|
||||
return Result::Invalid;
|
||||
|
||||
return (Result::Type)rt;
|
||||
return Result::Type(rt);
|
||||
}
|
||||
|
||||
QString TestResult::resultToString(const Result::Type type)
|
||||
|
@@ -38,7 +38,7 @@
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
|
||||
const static int outputLimit = 100000;
|
||||
constexpr int outputLimit = 100000;
|
||||
|
||||
static bool isSummaryItem(Result::Type type)
|
||||
{
|
||||
|
@@ -42,10 +42,6 @@ TestResultItem::TestResultItem(const TestResultPtr &testResult)
|
||||
{
|
||||
}
|
||||
|
||||
TestResultItem::~TestResultItem()
|
||||
{
|
||||
}
|
||||
|
||||
static QIcon testResultIcon(Result::Type result) {
|
||||
const static QIcon icons[] = {
|
||||
Icons::RESULT_PASS.icon(),
|
||||
|
@@ -41,7 +41,6 @@ class TestResultItem : public Utils::TreeItem
|
||||
{
|
||||
public:
|
||||
explicit TestResultItem(const TestResultPtr &testResult);
|
||||
~TestResultItem();
|
||||
QVariant data(int column, int role) const override;
|
||||
const TestResult *testResult() const { return m_testResult.data(); }
|
||||
void updateDescription(const QString &description);
|
||||
|
@@ -72,7 +72,7 @@ class TestResultsPane : public Core::IOutputPane
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
virtual ~TestResultsPane();
|
||||
~TestResultsPane() override;
|
||||
static TestResultsPane *instance();
|
||||
|
||||
// IOutputPane interface
|
||||
|
@@ -28,12 +28,12 @@
|
||||
#include "autotestplugin.h"
|
||||
#include "testconfiguration.h"
|
||||
|
||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||
#include <projectexplorer/applicationlauncher.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
|
@@ -564,16 +564,15 @@ void TestRunner::runOrDebugTests()
|
||||
case TestRunMode::Run:
|
||||
case TestRunMode::RunWithoutDeploy:
|
||||
runTests();
|
||||
break;
|
||||
return;
|
||||
case TestRunMode::Debug:
|
||||
case TestRunMode::DebugWithoutDeploy:
|
||||
debugTests();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
onFinished();
|
||||
QTC_ASSERT(false, return); // unexpected run mode
|
||||
}
|
||||
}
|
||||
|
||||
void TestRunner::buildProject(ProjectExplorer::Project *project)
|
||||
{
|
||||
|
@@ -52,12 +52,11 @@ namespace Internal {
|
||||
class AUTOTESTSHARED_EXPORT TestRunner : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum CancelReason { UserCanceled, Timeout, KitChanged };
|
||||
|
||||
static TestRunner* instance();
|
||||
~TestRunner();
|
||||
~TestRunner() override;
|
||||
|
||||
void setSelectedTests(const QList<TestConfiguration *> &selected);
|
||||
void runTest(TestRunMode mode, const TestTreeItem *item);
|
||||
|
@@ -44,7 +44,7 @@ static const char filtersKey[] = "WhiteListFilters";
|
||||
static const char processArgsKey[] = "ProcessArgs";
|
||||
static const char groupSuffix[] = ".group";
|
||||
|
||||
static const int defaultTimeout = 60000;
|
||||
constexpr int defaultTimeout = 60000;
|
||||
|
||||
TestSettings::TestSettings()
|
||||
: timeout(defaultTimeout)
|
||||
|
@@ -45,7 +45,7 @@ namespace Internal {
|
||||
class TestFilterDialog : public QDialog
|
||||
{
|
||||
public:
|
||||
explicit TestFilterDialog(QWidget *parent = nullptr, Qt::WindowFlags f = 0);
|
||||
explicit TestFilterDialog(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
|
||||
QString filterPath() const;
|
||||
void setDetailsText(const QString &details) { m_details->setText(details); }
|
||||
void setDefaultFilterPath(const QString &defaultPath);
|
||||
@@ -286,10 +286,6 @@ TestSettingsPage::TestSettingsPage(const QSharedPointer<TestSettings> &settings)
|
||||
Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint));
|
||||
}
|
||||
|
||||
TestSettingsPage::~TestSettingsPage()
|
||||
{
|
||||
}
|
||||
|
||||
QWidget *TestSettingsPage::widget()
|
||||
{
|
||||
if (!m_widget) {
|
||||
|
@@ -63,7 +63,6 @@ class TestSettingsPage : public Core::IOptionsPage
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TestSettingsPage(const QSharedPointer<TestSettings> &settings);
|
||||
~TestSettingsPage();
|
||||
|
||||
QWidget *widget() override;
|
||||
void apply() override;
|
||||
|
@@ -90,7 +90,7 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
|
||||
if (m_type == GroupNode)
|
||||
return QVariant();
|
||||
QVariant itemLink;
|
||||
itemLink.setValue(Utils::Link(m_filePath, m_line, m_column));
|
||||
itemLink.setValue(Utils::Link(m_filePath, int(m_line), int(m_column)));
|
||||
return itemLink;
|
||||
}
|
||||
case ItalicRole:
|
||||
@@ -107,7 +107,7 @@ bool TestTreeItem::setData(int /*column*/, const QVariant &data, int role)
|
||||
{
|
||||
if (role == Qt::CheckStateRole) {
|
||||
Qt::CheckState old = m_checked;
|
||||
m_checked = (Qt::CheckState)data.toInt();
|
||||
m_checked = Qt::CheckState(data.toInt());
|
||||
return m_checked != old;
|
||||
}
|
||||
return false;
|
||||
@@ -124,9 +124,6 @@ Qt::ItemFlags TestTreeItem::flags(int /*column*/) const
|
||||
return defaultFlags | Qt::ItemIsAutoTristate | Qt::ItemIsUserCheckable;
|
||||
case TestFunctionOrSet:
|
||||
return defaultFlags | Qt::ItemIsUserCheckable;
|
||||
case TestDataFunction:
|
||||
case TestSpecialFunction:
|
||||
case TestDataTag:
|
||||
default:
|
||||
return defaultFlags;
|
||||
}
|
||||
@@ -244,9 +241,8 @@ TestConfiguration *TestTreeItem::asConfiguration(TestRunMode mode) const
|
||||
case TestRunMode::Debug:
|
||||
case TestRunMode::DebugWithoutDeploy:
|
||||
return debugConfiguration();
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<TestConfiguration *> TestTreeItem::getAllTestConfigurations() const
|
||||
@@ -287,9 +283,8 @@ bool TestTreeItem::lessThan(const TestTreeItem *other, SortMode mode) const
|
||||
}
|
||||
return leftLink.targetFileName > rightLink.targetFileName;
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TestTreeItem::isGroupNodeFor(const TestTreeItem *other) const
|
||||
@@ -310,7 +305,7 @@ QSet<QString> TestTreeItem::internalTargets() const
|
||||
if (projectParts.isEmpty())
|
||||
return TestTreeItem::dependingInternalTargets(cppMM, m_filePath);
|
||||
QSet<QString> targets;
|
||||
for (const CppTools::ProjectPart::Ptr part : projectParts) {
|
||||
for (const CppTools::ProjectPart::Ptr &part : projectParts) {
|
||||
targets.insert(part->buildSystemTarget);
|
||||
if (part->buildTargetType != CppTools::ProjectPart::Executable)
|
||||
targets.unite(TestTreeItem::dependingInternalTargets(cppMM, m_filePath));
|
||||
@@ -367,7 +362,7 @@ QSet<QString> TestTreeItem::dependingInternalTargets(CppTools::CppModelManager *
|
||||
const Utils::FileNameList dependingFiles = snapshot.filesDependingOn(
|
||||
wasHeader ? file : correspondingFile);
|
||||
for (const Utils::FileName &fn : dependingFiles) {
|
||||
for (const CppTools::ProjectPart::Ptr part : cppMM->projectPart(fn))
|
||||
for (const CppTools::ProjectPart::Ptr &part : cppMM->projectPart(fn))
|
||||
result.insert(part->buildSystemTarget);
|
||||
}
|
||||
return result;
|
||||
|
@@ -50,6 +50,7 @@ namespace Internal {
|
||||
class TestParseResult;
|
||||
class TestConfiguration;
|
||||
enum class TestRunMode;
|
||||
|
||||
class TestTreeItem : public Utils::TypedTreeItem<TestTreeItem>
|
||||
{
|
||||
public:
|
||||
@@ -157,7 +158,7 @@ private:
|
||||
class TestCodeLocationAndType
|
||||
{
|
||||
public:
|
||||
QString m_name; // tag name for m_type == TEST_DATATAG, file name for other values
|
||||
QString m_name; // tag name for m_type == TestDataTag, file name for other values
|
||||
unsigned m_line = 0;
|
||||
unsigned m_column = 0;
|
||||
TestTreeItem::Type m_type = TestTreeItem::Root;
|
||||
|
@@ -36,10 +36,6 @@ TestTreeItemDelegate::TestTreeItemDelegate(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
TestTreeItemDelegate::~TestTreeItemDelegate()
|
||||
{
|
||||
}
|
||||
|
||||
void TestTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
QStyleOptionViewItem opt = option;
|
||||
|
@@ -35,7 +35,6 @@ class TestTreeItemDelegate : public QStyledItemDelegate
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TestTreeItemDelegate(QObject *parent = nullptr);
|
||||
~TestTreeItemDelegate();
|
||||
|
||||
public:
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
|
@@ -383,7 +383,7 @@ void TestTreeModel::revalidateCheckState(TestTreeItem *item)
|
||||
|| type == TestTreeItem::TestDataTag) {
|
||||
return;
|
||||
}
|
||||
const Qt::CheckState oldState = (Qt::CheckState)item->data(0, Qt::CheckStateRole).toInt();
|
||||
const Qt::CheckState oldState = Qt::CheckState(item->data(0, Qt::CheckStateRole).toInt());
|
||||
Qt::CheckState newState = Qt::Checked;
|
||||
bool foundChecked = false;
|
||||
bool foundUnchecked = false;
|
||||
|
@@ -47,7 +47,7 @@ class AUTOTESTSHARED_EXPORT TestTreeModel : public Utils::TreeModel<>
|
||||
Q_OBJECT
|
||||
public:
|
||||
static TestTreeModel* instance();
|
||||
~TestTreeModel();
|
||||
~TestTreeModel() override;
|
||||
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
Reference in New Issue
Block a user