ff7tk  0.02
Toolkit for making FF7 Tools
DoubleCheckBox.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // copyright 2012 - 2016 Chris Rizzitello <sithlord48@gmail.com> //
3 // //
4 // This file is part of FF7tk //
5 // //
6 // FF7tk is free software: you can redistribute it and/or modify //
7 // it under the terms of the GNU General Public License as published by //
8 // the Free Software Foundation, either version 3 of the License, or //
9 // (at your option) any later version. //
10 // //
11 // FF7tk is distributed in the hope that it will be useful, //
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14 // GNU General Public License for more details. //
15 /****************************************************************************/
16 
17 #ifndef DOUBLECHECKBOX_H
18 #define DOUBLECHECKBOX_H
19 
20 #include "qglobal.h"
21 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
22  #include <QtWidgets>
23 #else
24  #include <QtGui>
25 #endif
26 
30 class DoubleCheckBox : public QWidget
31 {
32  Q_OBJECT
33 public:
37  explicit DoubleCheckBox(qreal Scale=1,QWidget *parent = 0);
42  explicit DoubleCheckBox(const QString &text,qreal Scale=1,QWidget *parent = 0);
43 
47  void setText(QString text);
48 
53  void setChecked(int box,bool checked);
54 
59  bool checked(int box);
60 
65  void setBoxToolTip(int box,QString text);
66 
70  void setToolTip(QString text);
71 signals:
75  void box1_toggled(bool checked);
76 
80  void box2_toggled(bool checked);
81 
82 private slots:
83  void cb_one_toggled(bool checked);
84  void cb_two_toggled(bool checked);
85 private:
86  void init_display();
87  void init_connections();
88  QCheckBox *cb_one;
89  QCheckBox *cb_two;
90  QLabel * label;
91  qreal scale;
92 };
93 
94 #endif // DOUBLECHECKBOX_H
void box2_toggled(bool checked)
Signal: box2 has had its state changed.
void box1_toggled(bool checked)
Signal: box1 has had its state changed.
bool checked(int box)
check if a box has been checked .
void setToolTip(QString text)
Set the tooltip for the widget.
QCheckBox * cb_one
void setChecked(int box, bool checked)
set if a box is checked
void setText(QString text)
set the text displayed
void cb_one_toggled(bool checked)
void setBoxToolTip(int box, QString text)
Set the tooltip for a checkbox.
DoubleCheckBox(qreal Scale=1, QWidget *parent=0)
create a new empty Double Checkbox
void cb_two_toggled(bool checked)
QCheckBox * cb_two
one text two checkable boxes