ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
PhsListWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2012 - 2020 Chris Rizzitello <sithlord48@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QEvent>
7 #include <QLabel>
8 #include <ff7tkwidgets_export.h>
9 #include <DoubleCheckBox>
10 
16 class FF7TKWIDGETS_EXPORT PhsListWidget : public QWidget
17 {
18  Q_OBJECT
19 public:
23  enum Box {
24  PHSALLOWED = 1,
25  PHSVISIBLE = 2
26  };
27 
28  explicit PhsListWidget(QWidget *parent = nullptr);
29 
30 protected:
31  void changeEvent(QEvent *e);
32 
33 signals:
38  void allowedToggled(int row, bool checked);
39 
44  void visibleToggled(int row, bool checked);
45 public slots:
46 
52  void setChecked(int row, int box, bool checked);
53 
54 private slots:
55  void cb_cloud_allowedToggled(bool checked);
56  void cb_cloud_visibleToggled(bool checked);
57  void cb_barret_allowedToggled(bool checked);
58  void cb_barret_visibleToggled(bool checked);
59  void cb_tifa_allowedToggled(bool checked);
60  void cb_tifa_visibleToggled(bool checked);
61  void cb_aerith_allowedToggled(bool checked);
62  void cb_aerith_visibleToggled(bool checked);
63  void cb_red_allowedToggled(bool checked);
64  void cb_red_visibleToggled(bool checked);
65  void cb_yuffie_allowedToggled(bool checked);
66  void cb_yuffie_visibleToggled(bool checked);
67  void cb_cait_allowedToggled(bool checked);
68  void cb_cait_visibleToggled(bool checked);
69  void cb_vincent_allowedToggled(bool checked);
70  void cb_vincent_visibleToggled(bool checked);
71  void cb_cid_allowedToggled(bool checked);
72  void cb_cid_visibleToggled(bool checked);
73 
74 private:
75  DoubleCheckBox *cb_cloud = nullptr;
76  DoubleCheckBox *cb_barret = nullptr;
77  DoubleCheckBox *cb_tifa = nullptr;
78  DoubleCheckBox *cb_aerith = nullptr;
79  DoubleCheckBox *cb_red = nullptr;
80  DoubleCheckBox *cb_yuffie = nullptr;
81  DoubleCheckBox *cb_cait = nullptr;
82  DoubleCheckBox *cb_vincent = nullptr;
83  DoubleCheckBox *cb_cid = nullptr;
84  QLabel *lbl_phs = nullptr;
85  void init_display();
86  void connectAll();
87  void disconnectAll();
88  void updateText();
89 };
DoubleCheckBox
one text two checkable boxes
Definition: DoubleCheckBox.h:16
PhsListWidget
Easily manage the who can be in the phs.
Definition: PhsListWidget.h:16
PhsListWidget::Box
Box
Acces to Allow and Visible boxes without knowing their index.
Definition: PhsListWidget.h:23