PIVX Core  5.6.99
P2P Digital Currency
faqwidget.h
Go to the documentation of this file.
1 // Copyright (c) 2019-2022 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef PIVX_QT_SETTINGS_FAQWIDGET_H
6 #define PIVX_QT_SETTINGS_FAQWIDGET_H
7 
8 #include <QDialog>
9 
10 class MNModel;
11 class PIVXGUI;
12 
13 namespace Ui {
14 class SettingsFaqWidget;
15 }
16 
17 class SettingsFaqWidget : public QDialog
18 {
19  Q_OBJECT
20 public:
21  enum Section {
28  };
29 
30  explicit SettingsFaqWidget(PIVXGUI* parent, MNModel* _model);
32 
33  void showEvent(QShowEvent *event) override;
34 
35 public Q_SLOTS:
36  void windowResizeEvent(QResizeEvent* event);
37  void setSection(Section _section);
38 private Q_SLOTS:
39  void onFaqClicked(const QWidget* const widget);
40 private:
41  Ui::SettingsFaqWidget *ui;
43 
44  // This needs to be edited if changes are made to the Section enum.
45  std::vector<QPushButton*> getButtons();
46 
47  // Formats a QString into a FAQ Content section with HTML
48  static inline QString formatFAQContent(const QString& str) {
49  return "<html><head/><body>" + str + "</body></html>";
50  }
51 
52  // Formats a QString into a FAQ content paragraph with HTML
53  static inline QString formatFAQParagraph(const QString& str) {
54  return "<p align=\"justify\">" + str + "</p>";
55  }
56 
57  // Formats a QString into a FAQ content ordered list with HTML
58  static inline QString formatFAQOrderedList(const QString& str) {
59  return "<ol>" + str + "</ol>";
60  }
61 
62  // Formats a QString into a FAQ content un-ordered list with HTML
63  static inline QString formatFAQUnorderedList(const QString& str) {
64  return "<ul>" + str + "</ul>";
65  }
66 
67  // Formats a QString into a FAQ content list item with HTML
68  static inline QString formatFAQListItem(const QString& str) {
69  return "<li>" + str + "</li>";
70  }
71 };
72 
73 #endif // PIVX_QT_SETTINGS_FAQWIDGET_H
PIVX GUI main class.
Definition: pivxgui.h:46
std::vector< QPushButton * > getButtons()
Definition: faqwidget.cpp:208
static QString formatFAQUnorderedList(const QString &str)
Definition: faqwidget.h:63
Section section
Definition: faqwidget.h:42
static QString formatFAQContent(const QString &str)
Definition: faqwidget.h:48
void onFaqClicked(const QWidget *const widget)
Definition: faqwidget.cpp:196
void windowResizeEvent(QResizeEvent *event)
Definition: faqwidget.cpp:201
SettingsFaqWidget(PIVXGUI *parent, MNModel *_model)
Definition: faqwidget.cpp:18
void setSection(Section _section)
Definition: faqwidget.cpp:191
void showEvent(QShowEvent *event) override
Definition: faqwidget.cpp:184
static QString formatFAQParagraph(const QString &str)
Definition: faqwidget.h:53
static QString formatFAQOrderedList(const QString &str)
Definition: faqwidget.h:58
Ui::SettingsFaqWidget * ui
Definition: faqwidget.h:41
static QString formatFAQListItem(const QString &str)
Definition: faqwidget.h:68