Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcheckbox.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QCHECKBOX_H
6#define QCHECKBOX_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qabstractbutton.h>
10
12
13QT_BEGIN_NAMESPACE
14
15
16class QCheckBoxPrivate;
17class QStyleOptionButton;
18
19class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
20{
21 Q_OBJECT
22
23 Q_PROPERTY(bool tristate READ isTristate WRITE setTristate)
24
25public:
26 explicit QCheckBox(QWidget *parent = nullptr);
27 explicit QCheckBox(const QString &text, QWidget *parent = nullptr);
28 ~QCheckBox();
29
30 QSize sizeHint() const override;
31 QSize minimumSizeHint() const override;
32
33 void setTristate(bool y = true);
34 bool isTristate() const;
35
36 Qt::CheckState checkState() const;
37 void setCheckState(Qt::CheckState state);
38
39Q_SIGNALS:
40#if QT_DEPRECATED_SINCE(6, 9)
41 QT_MOC_COMPAT QT_DEPRECATED_VERSION_X_6_9("Use checkStateChanged() instead")
42 void stateChanged(int);
43#endif
44 void checkStateChanged(Qt::CheckState);
45
46protected:
47 bool event(QEvent *e) override;
48 bool hitButton(const QPoint &pos) const override;
49 void checkStateSet() override;
50 void nextCheckState() override;
51 void paintEvent(QPaintEvent *) override;
52 void mouseMoveEvent(QMouseEvent *) override;
53 virtual void initStyleOption(QStyleOptionButton *option) const;
54
55
56private:
57 Q_DECLARE_PRIVATE(QCheckBox)
58 Q_DISABLE_COPY(QCheckBox)
59 friend class QAccessibleButton;
60};
61
62QT_END_NAMESPACE
63
64#endif // QCHECKBOX_H
The QCheckBox widget provides a checkbox with a text label.
Definition qcheckbox.h:20
void helperPrepareShow(QPlatformDialogHelper *) override
void initHelper(QPlatformDialogHelper *) override
bool isMessageToBeShown(const QString &message, const QString &type) const
std::queue< Message > pending
void setVisible(bool) override
The QErrorMessage class provides an error message display dialog.
static QString msgType2i18nString(QtMsgType t)
static bool metFatal
static void deleteStaticcQErrorMessage()
static QErrorMessage * qtMessageHandler
static QtMessageHandler originalMessageHandler
static void jump(QtMsgType t, const QMessageLogContext &context, const QString &m)
QT_REQUIRE_CONFIG(errormessage)
QT_REQUIRE_CONFIG(thread)