|
35 | 35 | #include <QTextDocument> |
36 | 36 | #include <QWidget> |
37 | 37 |
|
38 | | -#ifdef HAVE_QCHART |
| 38 | +#ifdef QT_CHARTS_LIB |
39 | 39 | #include <QAbstractSeries> |
40 | 40 | #include <QChartView> |
41 | 41 | #include <QDateTimeAxis> |
|
44 | 44 | #include <QValueAxis> |
45 | 45 |
|
46 | 46 | #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) |
47 | | -using namespace QtCharts; |
| 47 | +QT_CHARTS_USE_NAMESPACE |
48 | 48 | #endif |
| 49 | + |
| 50 | +static QLineSeries *numberOfReports(const QString &fileName, const QString &severity); |
| 51 | +static QChartView *createChart(const QString &statsFile, const QString &tool); |
49 | 52 | #endif |
50 | 53 |
|
51 | 54 | static const QString CPPCHECK("cppcheck"); |
@@ -76,7 +79,7 @@ void StatsDialog::setProject(const ProjectFile* projectFile) |
76 | 79 | mUI->mIncludePaths->setText(projectFile->getIncludeDirs().join(";")); |
77 | 80 | mUI->mDefines->setText(projectFile->getDefines().join(";")); |
78 | 81 | mUI->mUndefines->setText(projectFile->getUndefines().join(";")); |
79 | | -#ifndef HAVE_QCHART |
| 82 | +#ifndef QT_CHARTS_LIB |
80 | 83 | mUI->mTabHistory->setVisible(false); |
81 | 84 | #else |
82 | 85 | QString statsFile; |
@@ -356,8 +359,8 @@ void StatsDialog::setStatistics(const CheckStatistics *stats) |
356 | 359 | mUI->mLblInformation->setText(QString("%1").arg(stats->getCount(CPPCHECK,ShowTypes::ShowInformation))); |
357 | 360 | } |
358 | 361 |
|
359 | | -#ifdef HAVE_QCHART |
360 | | -QChartView *StatsDialog::createChart(const QString &statsFile, const QString &tool) |
| 362 | +#ifdef QT_CHARTS_LIB |
| 363 | +QChartView *createChart(const QString &statsFile, const QString &tool) |
361 | 364 | { |
362 | 365 | QChart *chart = new QChart; |
363 | 366 | chart->addSeries(numberOfReports(statsFile, tool + "-error")); |
@@ -399,7 +402,7 @@ QChartView *StatsDialog::createChart(const QString &statsFile, const QString &to |
399 | 402 | return chartView; |
400 | 403 | } |
401 | 404 |
|
402 | | -QLineSeries *StatsDialog::numberOfReports(const QString &fileName, const QString &severity) const |
| 405 | +QLineSeries *numberOfReports(const QString &fileName, const QString &severity) |
403 | 406 | { |
404 | 407 | QLineSeries *series = new QLineSeries(); |
405 | 408 | series->setName(severity); |
|
0 commit comments