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