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
qquickbuttongroup_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
4#ifndef QQUICKBUTTONGROUP_P_H
5#define QQUICKBUTTONGROUP_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 <QtCore/qobject.h>
19#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
20#include <QtQml/qqml.h>
21#include <QtQml/qqmlparserstatus.h>
22
24
29
30class Q_QUICKTEMPLATES2_EXPORT QQuickButtonGroup : public QObject, public QQmlParserStatus
31{
33 Q_PROPERTY(QQuickAbstractButton *checkedButton READ checkedButton WRITE setCheckedButton NOTIFY checkedButtonChanged FINAL)
34 Q_PROPERTY(QQmlListProperty<QQuickAbstractButton> buttons READ buttons NOTIFY buttonsChanged FINAL)
35 // 2.3 (Qt 5.10)
36 Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL REVISION(2, 3))
37 // 2.4 (Qt 5.11)
38 Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL REVISION(2, 4))
40 QML_NAMED_ELEMENT(ButtonGroup)
43
44public:
45 explicit QQuickButtonGroup(QObject *parent = nullptr);
47
48 static QQuickButtonGroupAttached *qmlAttachedProperties(QObject *object);
49
50 QQuickAbstractButton *checkedButton() const;
51 void setCheckedButton(QQuickAbstractButton *checkedButton);
52
54
55 bool isExclusive() const;
56 void setExclusive(bool exclusive);
57
58 // 2.4 (Qt 5.11)
59 Qt::CheckState checkState() const;
60 void setCheckState(Qt::CheckState state);
61
62public Q_SLOTS:
63 void addButton(QQuickAbstractButton *button);
64 void removeButton(QQuickAbstractButton *button);
65
67 void checkedButtonChanged();
68 void buttonsChanged();
69 // 2.1 (Qt 5.8)
71 // 2.3 (Qt 5.10)
72 Q_REVISION(2, 3) void exclusiveChanged();
73 // 2.4 (Qt 5.11)
74 Q_REVISION(2, 4) void checkStateChanged();
75
76protected:
77 void classBegin() override;
78 void componentComplete() override;
79
81 Q_DISABLE_COPY(QQuickButtonGroup)
82 Q_DECLARE_PRIVATE(QQuickButtonGroup)
83
84 Q_PRIVATE_SLOT(d_func(), void _q_updateCurrent())
85};
86
87class Q_QUICKTEMPLATES2_EXPORT QQuickButtonGroupAttached : public QObject
88{
90 Q_PROPERTY(QQuickButtonGroup *group READ group WRITE setGroup NOTIFY groupChanged FINAL)
91
92public:
93 explicit QQuickButtonGroupAttached(QObject *parent = nullptr);
94
95 QQuickButtonGroup *group() const;
96 void setGroup(QQuickButtonGroup *group);
97
100
101private:
102 Q_DISABLE_COPY(QQuickButtonGroupAttached)
103 Q_DECLARE_PRIVATE(QQuickButtonGroupAttached)
104};
105
107
108#endif // QQUICKBUTTONGROUP_P_H
\inmodule QtCore
Definition qobject.h:103
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
The QQmlParserStatus class provides updates on the QML parser state.
Mutually-exclusive group of checkable buttons.
QPushButton * button
[2]
else opt state
[0]
Combined button and popup list for selecting options.
Definition qcompare.h:63
GLboolean GLuint group
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QML_ATTACHED(ATTACHED_TYPE)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
#define explicit