Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qcheckbox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QCHECKBOX_H
0005 #define QCHECKBOX_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qabstractbutton.h>
0009 
0010 QT_REQUIRE_CONFIG(checkbox);
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 
0015 class QCheckBoxPrivate;
0016 class QStyleOptionButton;
0017 
0018 class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
0019 {
0020     Q_OBJECT
0021 
0022     Q_PROPERTY(bool tristate READ isTristate WRITE setTristate)
0023 
0024 public:
0025     explicit QCheckBox(QWidget *parent = nullptr);
0026     explicit QCheckBox(const QString &text, QWidget *parent = nullptr);
0027     ~QCheckBox();
0028 
0029     QSize sizeHint() const override;
0030     QSize minimumSizeHint() const override;
0031 
0032     void setTristate(bool y = true);
0033     bool isTristate() const;
0034 
0035     Qt::CheckState checkState() const;
0036     void setCheckState(Qt::CheckState state);
0037 
0038 Q_SIGNALS:
0039 #if QT_DEPRECATED_SINCE(6, 9)
0040     QT_MOC_COMPAT QT_DEPRECATED_VERSION_X_6_9("Use checkStateChanged() instead")
0041     void stateChanged(int);
0042 #endif
0043     void checkStateChanged(Qt::CheckState);
0044 
0045 protected:
0046     bool event(QEvent *e) override;
0047     bool hitButton(const QPoint &pos) const override;
0048     void checkStateSet() override;
0049     void nextCheckState() override;
0050     void paintEvent(QPaintEvent *) override;
0051     void mouseMoveEvent(QMouseEvent *) override;
0052     virtual void initStyleOption(QStyleOptionButton *option) const;
0053 
0054 
0055 private:
0056     Q_DECLARE_PRIVATE(QCheckBox)
0057     Q_DISABLE_COPY(QCheckBox)
0058     friend class QAccessibleButton;
0059 };
0060 
0061 QT_END_NAMESPACE
0062 
0063 #endif // QCHECKBOX_H