1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef QCHECKBOX_H
- #define QCHECKBOX_H
- #include <QtWidgets/qabstractbutton.h>
- QT_BEGIN_NAMESPACE
- class QCheckBoxPrivate;
- class QStyleOptionButton;
- class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
- {
- Q_OBJECT
- Q_PROPERTY(bool tristate READ isTristate WRITE setTristate)
- public:
- explicit QCheckBox(QWidget *parent = Q_NULLPTR);
- explicit QCheckBox(const QString &text, QWidget *parent = Q_NULLPTR);
- ~QCheckBox();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- void setTristate(bool y = true);
- bool isTristate() const;
- Qt::CheckState checkState() const;
- void setCheckState(Qt::CheckState state);
- Q_SIGNALS:
- void stateChanged(int);
- protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- bool hitButton(const QPoint &pos) const Q_DECL_OVERRIDE;
- void checkStateSet() Q_DECL_OVERRIDE;
- void nextCheckState() Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void initStyleOption(QStyleOptionButton *option) const;
- private:
- Q_DECLARE_PRIVATE(QCheckBox)
- Q_DISABLE_COPY(QCheckBox)
- friend class QAccessibleButton;
- };
- QT_END_NAMESPACE
- #endif
|