Cppcheck
statsdialog.h
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2023 Cppcheck team.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef STATSDIALOG_H
20 #define STATSDIALOG_H
21 
22 #include <QDialog>
23 #include <QObject>
24 #include <QString>
25 
26 class ProjectFile;
27 class CheckStatistics;
28 class QWidget;
29 namespace Ui {
30  class StatsDialog;
31 }
32 
33 /// @addtogroup GUI
34 /// @{
35 
36 /**
37  * @brief A dialog that shows project and scan statistics.
38  *
39  */
40 class StatsDialog : public QDialog {
41  Q_OBJECT
42 public:
43  explicit StatsDialog(QWidget *parent = nullptr);
44  ~StatsDialog() override;
45 
46  /**
47  * @brief Sets the project to extract statistics from
48  */
49  void setProject(const ProjectFile *projectFile);
50 
51  /**
52  * @brief Sets the string to display beside "Path Selected:"
53  */
54  void setPathSelected(const QString& path);
55 
56  /**
57  * @brief Sets the number to display beside "Number of Files Scanned:"
58  */
59  void setNumberOfFilesScanned(int num);
60 
61  /**
62  * @brief Sets the number of seconds to display beside "Scan Duration:"
63  */
64  void setScanDuration(double seconds);
65 
66  /**
67  * @brief Sets the numbers of different error/warnings found."
68  */
69  void setStatistics(const CheckStatistics *stats);
70 
71 private slots:
72  void copyToClipboard();
73  void pdfExport();
74 private:
75  Ui::StatsDialog *mUI;
77 };
78 
79 /// @}
80 
81 #endif // STATSDIALOG_H
A class for check statistics.
A class that reads and writes project files.
Definition: projectfile.h:46
A dialog that shows project and scan statistics.
Definition: statsdialog.h:40
void setScanDuration(double seconds)
Sets the number of seconds to display beside "Scan Duration:".
~StatsDialog() override
Definition: statsdialog.cpp:90
void setNumberOfFilesScanned(int num)
Sets the number to display beside "Number of Files Scanned:".
void pdfExport()
Ui::StatsDialog * mUI
Definition: statsdialog.h:75
void copyToClipboard()
void setProject(const ProjectFile *projectFile)
Sets the project to extract statistics from.
Definition: statsdialog.cpp:95
void setStatistics(const CheckStatistics *stats)
Sets the numbers of different error/warnings found.
void setPathSelected(const QString &path)
Sets the string to display beside "Path Selected:".
const CheckStatistics * mStatistics
Definition: statsdialog.h:76
StatsDialog(QWidget *parent=nullptr)
Definition: statsdialog.cpp:74
Definition: aboutdialog.h:27