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