Cppcheck
fileviewdialog.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 FILEVIEW_DIALOG_H
20 #define FILEVIEW_DIALOG_H
21 
22 #include <QDialog>
23 #include <QObject>
24 #include <QString>
25 
26 class QWidget;
27 class QTextEdit;
28 namespace Ui {
29  class Fileview;
30 }
31 
32 /// @addtogroup GUI
33 /// @{
34 
35 
36 /**
37  * @brief File view -dialog.
38  * This dialog shows text files. It is used for showing the license file and
39  * the authors list.
40  *
41  */
42 class FileViewDialog : public QDialog {
43  Q_OBJECT
44 public:
45  FileViewDialog(const QString &file,
46  const QString &title,
47  QWidget *parent = nullptr);
48 
49  ~FileViewDialog() override;
50 
51 protected:
52 
53  /**
54  * @brief Load text file contents to edit control.
55  *
56  * @param filename File to load.
57  * @param edit Control where to load the file contents.
58  */
59  void loadTextFile(const QString &filename, QTextEdit *edit);
60 
61  Ui::Fileview* mUI;
62 };
63 /// @}
64 #endif // FILEVIEW_DIALOG_H
File view -dialog.
~FileViewDialog() override
void loadTextFile(const QString &filename, QTextEdit *edit)
Load text file contents to edit control.
Ui::Fileview * mUI
FileViewDialog(const QString &file, const QString &title, QWidget *parent=nullptr)
Definition: aboutdialog.h:27