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 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class QQuickCheckBoxPrivate; |
23 | |
24 | class Q_QUICKTEMPLATES2_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_PROPERTY(QJSValue nextCheckState READ getNextCheckState WRITE setNextCheckState NOTIFY |
31 | nextCheckStateChanged FINAL REVISION(2, 4)) |
32 | QML_NAMED_ELEMENT(CheckBox) |
33 | QML_ADDED_IN_VERSION(2, 0) |
34 | |
35 | public: |
36 | explicit QQuickCheckBox(QQuickItem *parent = nullptr); |
37 | |
38 | bool isTristate() const; |
39 | void setTristate(bool tristate); |
40 | |
41 | Qt::CheckState checkState() const; |
42 | void setCheckState(Qt::CheckState state); |
43 | QJSValue getNextCheckState() const; |
44 | void setNextCheckState(const QJSValue &callback); |
45 | |
46 | Q_SIGNALS: |
47 | void tristateChanged(); |
48 | void checkStateChanged(); |
49 | // 2.4 (Qt 5.11) |
50 | Q_REVISION(2, 4) void nextCheckStateChanged(); |
51 | |
52 | protected: |
53 | QFont defaultFont() const override; |
54 | |
55 | void buttonChange(ButtonChange change) override; |
56 | void nextCheckState() override; |
57 | |
58 | private: |
59 | Q_DISABLE_COPY(QQuickCheckBox) |
60 | Q_DECLARE_PRIVATE(QQuickCheckBox) |
61 | }; |
62 | |
63 | QT_END_NAMESPACE |
64 | |
65 | #endif // QQUICKCHECKBOX_P_H |
66 | |