Cppcheck
helpdialog.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 HELPDIALOG_H
20 #define HELPDIALOG_H
21 
22 #include <QDialog>
23 #include <QObject>
24 #include <QString>
25 #include <QTextBrowser>
26 #include <QVariant>
27 
28 class QHelpEngine;
29 class QUrl;
30 class QWidget;
31 namespace Ui {
32  class HelpDialog;
33 }
34 
35 class HelpBrowser : public QTextBrowser {
36 public:
37  explicit HelpBrowser(QWidget* parent = nullptr) : QTextBrowser(parent) {}
38  HelpBrowser(const HelpBrowser&) = delete;
39  HelpBrowser(HelpBrowser&&) = delete;
40  HelpBrowser& operator=(const HelpBrowser&) = delete;
42  void setHelpEngine(QHelpEngine *helpEngine);
43  QVariant loadResource(int type, const QUrl& name) override;
44 private:
45  QHelpEngine* mHelpEngine{};
46 };
47 
48 class HelpDialog : public QDialog {
49  Q_OBJECT
50 
51 public:
52  explicit HelpDialog(QWidget *parent = nullptr);
53  ~HelpDialog() override;
54 
55 private:
56  Ui::HelpDialog *mUi;
57  QHelpEngine* mHelpEngine;
58 };
59 
60 #endif // HELPDIALOG_H
void setHelpEngine(QHelpEngine *helpEngine)
Definition: helpdialog.cpp:37
QVariant loadResource(int type, const QUrl &name) override
Definition: helpdialog.cpp:42
HelpBrowser(QWidget *parent=nullptr)
Definition: helpdialog.h:37
HelpBrowser & operator=(HelpBrowser &&)=delete
HelpBrowser & operator=(const HelpBrowser &)=delete
HelpBrowser(HelpBrowser &&)=delete
HelpBrowser(const HelpBrowser &)=delete
QHelpEngine * mHelpEngine
Definition: helpdialog.h:45
~HelpDialog() override
Definition: helpdialog.cpp:116
QHelpEngine * mHelpEngine
Definition: helpdialog.h:57
Ui::HelpDialog * mUi
Definition: helpdialog.h:56
HelpDialog(QWidget *parent=nullptr)
Definition: helpdialog.cpp:75
Definition: aboutdialog.h:27