1// Copyright (C) 2017 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 QQUICKCHECKBOX_P_H
5#define QQUICKCHECKBOX_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQuickCheckBoxPrivate;
23
24class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickCheckBox : public QQuickAbstractButton
25{
26 Q_OBJECT
27 Q_PROPERTY(bool tristate READ isTristate WRITE setTristate NOTIFY tristateChanged FINAL)
28 Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL)
29 // 2.4 (Qt 5.11)
30 Q_PRIVATE_PROPERTY(QQuickCheckBox::d_func(), QJSValue nextCheckState MEMBER nextCheckState WRITE setNextCheckState NOTIFY nextCheckStateChanged FINAL REVISION(2, 4))
31 QML_NAMED_ELEMENT(CheckBox)
32 QML_ADDED_IN_VERSION(2, 0)
33
34public:
35 explicit QQuickCheckBox(QQuickItem *parent = nullptr);
36
37 bool isTristate() const;
38 void setTristate(bool tristate);
39
40 Qt::CheckState checkState() const;
41 void setCheckState(Qt::CheckState state);
42
43Q_SIGNALS:
44 void tristateChanged();
45 void checkStateChanged();
46 // 2.4 (Qt 5.11)
47 Q_REVISION(2, 4) void nextCheckStateChanged();
48
49protected:
50 QFont defaultFont() const override;
51
52 void buttonChange(ButtonChange change) override;
53 void nextCheckState() override;
54
55private:
56 Q_DISABLE_COPY(QQuickCheckBox)
57 Q_DECLARE_PRIVATE(QQuickCheckBox)
58};
59
60QT_END_NAMESPACE
61
62QML_DECLARE_TYPE(QQuickCheckBox)
63
64#endif // QQUICKCHECKBOX_P_H
65

source code of qtdeclarative/src/quicktemplates/qquickcheckbox_p.h