cleaned up GUI includes based on include-what-you-use (#3792)

This commit is contained in:
Oliver Stöneberg 2022-02-02 22:31:51 +01:00 committed by GitHub
parent a20465eaea
commit 58f9672ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 30 additions and 24 deletions

View File

@ -21,8 +21,6 @@
#include "application.h" #include "application.h"
#include "common.h" #include "common.h"
#include <cstdlib>
#include <QFileInfo> #include <QFileInfo>
#include <QSettings> #include <QSettings>
#include <QStringList> #include <QStringList>

View File

@ -32,7 +32,6 @@
#include <QApplication> #include <QApplication>
#include <QCoreApplication> #include <QCoreApplication>
#include <QMetaType>
#include <QStringList> #include <QStringList>
#include <QSettings> #include <QSettings>

View File

@ -20,9 +20,7 @@
#include "common.h" #include "common.h"
#include <QMap>
#include <QSettings> #include <QSettings>
#include <QString>
ShowTypes::ShowTypes() ShowTypes::ShowTypes()
{ {

View File

@ -31,6 +31,17 @@
#include <QTextDocument> #include <QTextDocument>
#include <QWidget> #include <QWidget>
#ifdef HAVE_QCHART
#include <QAbstractSeries>
#include <QChartView>
#include <QDateTimeAxis>
#include <QLineSeries>
#include <QTextStream>
#include <QValueAxis>
using namespace QtCharts;
#endif
static const QString CPPCHECK("cppcheck"); static const QString CPPCHECK("cppcheck");
StatsDialog::StatsDialog(QWidget *parent) StatsDialog::StatsDialog(QWidget *parent)

View File

@ -22,13 +22,17 @@
#include "ui_stats.h" #include "ui_stats.h"
#include <QDialog> #include <QDialog>
#ifdef HAVE_QCHART
#include <QtCharts>
#endif
class ProjectFile; class ProjectFile;
class CheckStatistics; class CheckStatistics;
#ifdef HAVE_QCHART
namespace QtCharts {
class QChartView;
class QLineSeries;
}
#endif
/// @addtogroup GUI /// @addtogroup GUI
/// @{ /// @{
@ -70,8 +74,8 @@ private slots:
void copyToClipboard(); void copyToClipboard();
void pdfExport(); void pdfExport();
#ifdef HAVE_QCHART #ifdef HAVE_QCHART
QChartView *createChart(const QString &statsFile, const QString &tool); QtCharts::QChartView *createChart(const QString &statsFile, const QString &tool);
QLineSeries *numberOfReports(const QString &fileName, const QString &severity) const; QtCharts::QLineSeries *numberOfReports(const QString &fileName, const QString &severity) const;
#endif #endif
private: private:
Ui::StatsDialog mUI; Ui::StatsDialog mUI;

View File

@ -19,15 +19,14 @@
#include "benchmarksimple.h" #include "benchmarksimple.h"
#include "settings.h" #include "settings.h"
#include "token.h"
#include "tokenize.h" #include "tokenize.h"
#include <sstream> #include <sstream>
#include <QByteArray> #include <QByteArray>
#include <QFile> #include <QFile>
#include <QObject>
#include <QString> #include <QString>
#include <QtTest>
void BenchmarkSimple::tokenize() void BenchmarkSimple::tokenize()
{ {

View File

@ -19,7 +19,6 @@
#include "errorlogger.h" #include "errorlogger.h"
#include <QObject> #include <QObject>
#include <QtTest/QtTest>
class BenchmarkSimple : public QObject, public ErrorLogger { class BenchmarkSimple : public QObject, public ErrorLogger {
Q_OBJECT Q_OBJECT

View File

@ -18,6 +18,9 @@
#include "testcppchecklibrarydata.h" #include "testcppchecklibrarydata.h"
#include <QDebug>
#include <QTest>
const QString TestCppcheckLibraryData::TempCfgFile = "./tmp.cfg"; const QString TestCppcheckLibraryData::TempCfgFile = "./tmp.cfg";
void TestCppcheckLibraryData::init() void TestCppcheckLibraryData::init()

View File

@ -18,7 +18,7 @@
#include "cppchecklibrarydata.h" #include "cppchecklibrarydata.h"
#include <QtTest/QtTest> #include <QObject>
class TestCppcheckLibraryData : public QObject { class TestCppcheckLibraryData : public QObject {
Q_OBJECT Q_OBJECT

View File

@ -21,8 +21,8 @@
#include "filelist.h" #include "filelist.h"
#include <QDir> #include <QDir>
#include <QObject>
#include <QString> #include <QString>
#include <QTest>
void TestFileList::addFile() void TestFileList::addFile()
{ {

View File

@ -17,7 +17,6 @@
*/ */
#include <QObject> #include <QObject>
#include <QtTest/QtTest>
class TestFileList : public QObject { class TestFileList : public QObject {
Q_OBJECT Q_OBJECT

View File

@ -21,7 +21,7 @@
#include "projectfile.h" #include "projectfile.h"
#include "settings.h" #include "settings.h"
#include <QObject> #include <QtTest>
// Mock... // Mock...
const char Settings::SafeChecks::XmlRootName[] = "safe-checks"; const char Settings::SafeChecks::XmlRootName[] = "safe-checks";

View File

@ -17,7 +17,6 @@
*/ */
#include <QObject> #include <QObject>
#include <QtTest/QtTest>
class TestProjectFile : public QObject { class TestProjectFile : public QObject {
Q_OBJECT Q_OBJECT

View File

@ -20,7 +20,7 @@
#include "translationhandler.h" #include "translationhandler.h"
#include <QObject> #include <QtTest>
static const QStringList getTranslationNames(const TranslationHandler& handler) static const QStringList getTranslationNames(const TranslationHandler& handler)
{ {

View File

@ -17,7 +17,6 @@
*/ */
#include <QObject> #include <QObject>
#include <QtTest/QtTest>
class TestTranslationHandler : public QObject { class TestTranslationHandler : public QObject {
Q_OBJECT Q_OBJECT

View File

@ -21,7 +21,7 @@
#include "erroritem.h" #include "erroritem.h"
#include "xmlreportv2.h" #include "xmlreportv2.h"
#include <QObject> #include <QtTest>
void TestXmlReportV2::readXml() void TestXmlReportV2::readXml()
{ {

View File

@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QtTest/QtTest>
#include <QObject> #include <QObject>
class TestXmlReportV2 : public QObject { class TestXmlReportV2 : public QObject {

View File

@ -21,7 +21,6 @@
#include <QList> #include <QList>
#include <QObject> #include <QObject>
#include <QStringList>
class QTranslator; class QTranslator;

View File

@ -19,7 +19,7 @@
// Generate Makefile for cppcheck // Generate Makefile for cppcheck
#include <algorithm> #include <algorithm>
#include <fstream> #include <fstream> // IWYU pragma: keep
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>