Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
13
14
17
18class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
19{
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
36 void setCheckState(Qt::CheckState state);
37
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
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
62
63#endif // QCHECKBOX_H
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
The QCheckBox widget provides a checkbox with a text label.
Definition qcheckbox.h:19
void checkStateChanged(Qt::CheckState)
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtGui
Definition qevent.h:196
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\variable QStyleOptionHeaderV2::textElideMode
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QString text
else opt state
[0]
Combined button and popup list for selecting options.
CheckState
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
GLint y
struct _cl_event * event
GLuint GLenum option
#define QT_MOC_COMPAT
#define QT_REQUIRE_CONFIG(feature)
#define QT_DEPRECATED_VERSION_X_6_9(text)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
QCheckBox * checkbox
[0]