1 /*
2  * DQt - D bindings for the Qt Toolkit
3  *
4  * GNU Lesser General Public License Usage
5  * This file may be used under the terms of the GNU Lesser
6  * General Public License version 3 as published by the Free Software
7  * Foundation and appearing in the file LICENSE.LGPL3 included in the
8  * packaging of this file. Please review the following information to
9  * ensure the GNU Lesser General Public License version 3 requirements
10  * will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
11  */
12 module qt.widgets.checkbox;
13 extern(C++):
14 
15 import qt.config;
16 import qt.core.coreevent;
17 import qt.core.namespace;
18 import qt.core.point;
19 import qt.core.size;
20 import qt.core.string;
21 import qt.gui.event;
22 import qt.helpers;
23 import qt.widgets.abstractbutton;
24 import qt.widgets.styleoption;
25 import qt.widgets.widget;
26 
27 /+ QT_REQUIRE_CONFIG(checkbox); +/
28 
29 
30 
31 extern(C++, class) struct QCheckBoxPrivate;
32 
33 /// Binding for C++ class [QCheckBox](https://doc.qt.io/qt-6/qcheckbox.html).
34 class /+ Q_WIDGETS_EXPORT +/ QCheckBox : QAbstractButton
35 {
36     mixin(Q_OBJECT);
37 
38     /+ Q_PROPERTY(bool tristate READ isTristate WRITE setTristate) +/
39 
40 public:
41     /+ explicit +/this(QWidget parent = null);
42     /+ explicit +/this(ref const(QString) text, QWidget parent = null);
43     ~this();
44 
45     override QSize sizeHint() const;
46     override QSize minimumSizeHint() const;
47 
48     final void setTristate(bool y = true);
49     final bool isTristate() const;
50 
51     final /+ Qt:: +/qt.core.namespace.CheckState checkState() const;
52     final void setCheckState(/+ Qt:: +/qt.core.namespace.CheckState state);
53 
54 /+ Q_SIGNALS +/public:
55     @QSignal final void stateChanged(int);
56 
57 protected:
58     override bool event(QEvent e);
59     override bool hitButton(ref const(QPoint) pos) const;
60     override void checkStateSet();
61     override void nextCheckState();
62     override void paintEvent(QPaintEvent );
63     override void mouseMoveEvent(QMouseEvent );
64     /+ virtual +/ void initStyleOption(QStyleOptionButton* option) const;
65 
66 
67 private:
68     /+ Q_DECLARE_PRIVATE(QCheckBox) +/
69     /+ Q_DISABLE_COPY(QCheckBox) +/
70     /+ friend class QAccessibleButton; +/
71     mixin(CREATE_CONVENIENCE_WRAPPERS);
72 }
73