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
4#ifndef QCHECKBOX_H
5#define QCHECKBOX_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qabstractbutton.h>
9
11
12QT_BEGIN_NAMESPACE
13
14
15class QCheckBoxPrivate;
16class QStyleOptionButton;
17
18class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
19{
20 Q_OBJECT
21
22 Q_PROPERTY(bool tristate READ isTristate WRITE setTristate)
23
24public:
25 explicit QCheckBox(QWidget *parent = nullptr);
26 explicit QCheckBox(const QString &text, QWidget *parent = nullptr);
27 ~QCheckBox();
28
29 QSize sizeHint() const override;
30 QSize minimumSizeHint() const override;
31
32 void setTristate(bool y = true);
33 bool isTristate() const;
34
35 Qt::CheckState checkState() const;
36 void setCheckState(Qt::CheckState state);
37
38Q_SIGNALS:
39#if QT_DEPRECATED_SINCE(6, 9)
40 QT_MOC_COMPAT QT_DEPRECATED_VERSION_X_6_9("Use checkStateChanged() instead")
41 void stateChanged(int);
42#endif
43 void checkStateChanged(Qt::CheckState);
44
45protected:
46 bool event(QEvent *e) override;
47 bool hitButton(const QPoint &pos) const override;
48 void checkStateSet() override;
49 void nextCheckState() override;
50 void paintEvent(QPaintEvent *) override;
51 void mouseMoveEvent(QMouseEvent *) override;
52 virtual void initStyleOption(QStyleOptionButton *option) const;
53
54
55private:
56 Q_DECLARE_PRIVATE(QCheckBox)
57 Q_DISABLE_COPY(QCheckBox)
58 friend class QAccessibleButton;
59};
60
61QT_END_NAMESPACE
62
63#endif // QCHECKBOX_H
The QCheckBox widget provides a checkbox with a text label.
Definition qcheckbox.h:19
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(itemmodel)