diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 599175145..ab1285337 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -21,8 +21,6 @@ #include "application.h" #include "common.h" -#include - #include #include #include diff --git a/gui/main.cpp b/gui/main.cpp index b57eb7d6f..7a79be5b7 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include diff --git a/gui/showtypes.cpp b/gui/showtypes.cpp index 0c636ebee..24ebbb962 100644 --- a/gui/showtypes.cpp +++ b/gui/showtypes.cpp @@ -20,9 +20,7 @@ #include "common.h" -#include #include -#include ShowTypes::ShowTypes() { diff --git a/gui/statsdialog.cpp b/gui/statsdialog.cpp index 525c9c96d..67b1215f9 100644 --- a/gui/statsdialog.cpp +++ b/gui/statsdialog.cpp @@ -31,6 +31,17 @@ #include #include +#ifdef HAVE_QCHART +#include +#include +#include +#include +#include +#include + +using namespace QtCharts; +#endif + static const QString CPPCHECK("cppcheck"); StatsDialog::StatsDialog(QWidget *parent) diff --git a/gui/statsdialog.h b/gui/statsdialog.h index 66516cd7b..c8190d82a 100644 --- a/gui/statsdialog.h +++ b/gui/statsdialog.h @@ -22,13 +22,17 @@ #include "ui_stats.h" #include -#ifdef HAVE_QCHART -#include -#endif class ProjectFile; class CheckStatistics; +#ifdef HAVE_QCHART +namespace QtCharts { + class QChartView; + class QLineSeries; +} +#endif + /// @addtogroup GUI /// @{ @@ -70,8 +74,8 @@ private slots: void copyToClipboard(); void pdfExport(); #ifdef HAVE_QCHART - QChartView *createChart(const QString &statsFile, const QString &tool); - QLineSeries *numberOfReports(const QString &fileName, const QString &severity) const; + QtCharts::QChartView *createChart(const QString &statsFile, const QString &tool); + QtCharts::QLineSeries *numberOfReports(const QString &fileName, const QString &severity) const; #endif private: Ui::StatsDialog mUI; diff --git a/gui/test/benchmark/simple/benchmarksimple.cpp b/gui/test/benchmark/simple/benchmarksimple.cpp index 139afecb9..2968b1e13 100644 --- a/gui/test/benchmark/simple/benchmarksimple.cpp +++ b/gui/test/benchmark/simple/benchmarksimple.cpp @@ -19,15 +19,14 @@ #include "benchmarksimple.h" #include "settings.h" -#include "token.h" #include "tokenize.h" #include #include #include -#include #include +#include void BenchmarkSimple::tokenize() { diff --git a/gui/test/benchmark/simple/benchmarksimple.h b/gui/test/benchmark/simple/benchmarksimple.h index 1f021700f..ec5ca9974 100644 --- a/gui/test/benchmark/simple/benchmarksimple.h +++ b/gui/test/benchmark/simple/benchmarksimple.h @@ -19,7 +19,6 @@ #include "errorlogger.h" #include -#include class BenchmarkSimple : public QObject, public ErrorLogger { Q_OBJECT diff --git a/gui/test/cppchecklibrarydata/testcppchecklibrarydata.cpp b/gui/test/cppchecklibrarydata/testcppchecklibrarydata.cpp index 71659b7cf..3088b007b 100644 --- a/gui/test/cppchecklibrarydata/testcppchecklibrarydata.cpp +++ b/gui/test/cppchecklibrarydata/testcppchecklibrarydata.cpp @@ -18,6 +18,9 @@ #include "testcppchecklibrarydata.h" +#include +#include + const QString TestCppcheckLibraryData::TempCfgFile = "./tmp.cfg"; void TestCppcheckLibraryData::init() diff --git a/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h b/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h index fdc1120f9..dfaa0c674 100644 --- a/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h +++ b/gui/test/cppchecklibrarydata/testcppchecklibrarydata.h @@ -18,7 +18,7 @@ #include "cppchecklibrarydata.h" -#include +#include class TestCppcheckLibraryData : public QObject { Q_OBJECT diff --git a/gui/test/filelist/testfilelist.cpp b/gui/test/filelist/testfilelist.cpp index 51dc9bea0..c0f25fa22 100644 --- a/gui/test/filelist/testfilelist.cpp +++ b/gui/test/filelist/testfilelist.cpp @@ -21,8 +21,8 @@ #include "filelist.h" #include -#include #include +#include void TestFileList::addFile() { diff --git a/gui/test/filelist/testfilelist.h b/gui/test/filelist/testfilelist.h index 698d60569..61e579d0b 100644 --- a/gui/test/filelist/testfilelist.h +++ b/gui/test/filelist/testfilelist.h @@ -17,7 +17,6 @@ */ #include -#include class TestFileList : public QObject { Q_OBJECT diff --git a/gui/test/projectfile/testprojectfile.cpp b/gui/test/projectfile/testprojectfile.cpp index e913780fc..52ce479c3 100644 --- a/gui/test/projectfile/testprojectfile.cpp +++ b/gui/test/projectfile/testprojectfile.cpp @@ -21,7 +21,7 @@ #include "projectfile.h" #include "settings.h" -#include +#include // Mock... const char Settings::SafeChecks::XmlRootName[] = "safe-checks"; diff --git a/gui/test/projectfile/testprojectfile.h b/gui/test/projectfile/testprojectfile.h index 31a49ebd4..ac01d5b54 100644 --- a/gui/test/projectfile/testprojectfile.h +++ b/gui/test/projectfile/testprojectfile.h @@ -17,7 +17,6 @@ */ #include -#include class TestProjectFile : public QObject { Q_OBJECT diff --git a/gui/test/translationhandler/testtranslationhandler.cpp b/gui/test/translationhandler/testtranslationhandler.cpp index a3d188aab..b09935ce0 100644 --- a/gui/test/translationhandler/testtranslationhandler.cpp +++ b/gui/test/translationhandler/testtranslationhandler.cpp @@ -20,7 +20,7 @@ #include "translationhandler.h" -#include +#include static const QStringList getTranslationNames(const TranslationHandler& handler) { diff --git a/gui/test/translationhandler/testtranslationhandler.h b/gui/test/translationhandler/testtranslationhandler.h index 534890003..c18308b89 100644 --- a/gui/test/translationhandler/testtranslationhandler.h +++ b/gui/test/translationhandler/testtranslationhandler.h @@ -17,7 +17,6 @@ */ #include -#include class TestTranslationHandler : public QObject { Q_OBJECT diff --git a/gui/test/xmlreportv2/testxmlreportv2.cpp b/gui/test/xmlreportv2/testxmlreportv2.cpp index c06c538c7..07496962d 100644 --- a/gui/test/xmlreportv2/testxmlreportv2.cpp +++ b/gui/test/xmlreportv2/testxmlreportv2.cpp @@ -21,7 +21,7 @@ #include "erroritem.h" #include "xmlreportv2.h" -#include +#include void TestXmlReportV2::readXml() { diff --git a/gui/test/xmlreportv2/testxmlreportv2.h b/gui/test/xmlreportv2/testxmlreportv2.h index 754f697d3..b78b50f4b 100644 --- a/gui/test/xmlreportv2/testxmlreportv2.h +++ b/gui/test/xmlreportv2/testxmlreportv2.h @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include #include class TestXmlReportV2 : public QObject { diff --git a/gui/translationhandler.h b/gui/translationhandler.h index 4e644bc18..2593fc962 100644 --- a/gui/translationhandler.h +++ b/gui/translationhandler.h @@ -21,7 +21,6 @@ #include #include -#include class QTranslator; diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 9d41c53b1..351ef33f9 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -19,7 +19,7 @@ // Generate Makefile for cppcheck #include -#include +#include // IWYU pragma: keep #include #include #include