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
qquickactiongroup_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 QQUICKACTIONGROUP_P_H
6#define QQUICKACTIONGROUP_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 <QtCore/qobject.h>
20#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
21#include <QtQml/qqml.h>
22
24
25class QQuickAction;
27class QQuickActionGroupAttached;
29
30class Q_QUICKTEMPLATES2_EXPORT QQuickActionGroup : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY(QQuickAction *checkedAction READ checkedAction WRITE setCheckedAction NOTIFY checkedActionChanged FINAL)
34 Q_PROPERTY(QQmlListProperty<QQuickAction> actions READ actions NOTIFY actionsChanged FINAL)
35 Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL)
36 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
37 Q_CLASSINFO("DefaultProperty", "actions")
38 QML_NAMED_ELEMENT(ActionGroup)
39 QML_ATTACHED(QQuickActionGroupAttached)
40 QML_ADDED_IN_VERSION(2, 3)
41
42public:
43 explicit QQuickActionGroup(QObject *parent = nullptr);
44 ~QQuickActionGroup();
45
46 static QQuickActionGroupAttached *qmlAttachedProperties(QObject *object);
47
48 QQuickAction *checkedAction() const;
49 void setCheckedAction(QQuickAction *checkedAction);
50
51 QQmlListProperty<QQuickAction> actions();
52
53 bool isExclusive() const;
54 void setExclusive(bool exclusive);
55
56 bool isEnabled() const;
57 void setEnabled(bool enabled);
58
59public Q_SLOTS:
60 void addAction(QQuickAction *action);
61 void removeAction(QQuickAction *action);
62
63Q_SIGNALS:
64 void checkedActionChanged();
65 void actionsChanged();
66 void exclusiveChanged();
67 void enabledChanged();
68 void triggered(QQuickAction *action);
69
70private:
71 Q_DISABLE_COPY(QQuickActionGroup)
72 Q_DECLARE_PRIVATE(QQuickActionGroup)
73
74 Q_PRIVATE_SLOT(d_func(), void _q_updateCurrent())
75};
76
77class Q_QUICKTEMPLATES2_EXPORT QQuickActionGroupAttached : public QObject
78{
79 Q_OBJECT
80 Q_PROPERTY(QQuickActionGroup *group READ group WRITE setGroup NOTIFY groupChanged FINAL)
81
82public:
83 explicit QQuickActionGroupAttached(QObject *parent = nullptr);
84
85 QQuickActionGroup *group() const;
86 void setGroup(QQuickActionGroup *group);
87
88Q_SIGNALS:
89 void groupChanged();
90
91private:
92 Q_DISABLE_COPY(QQuickActionGroupAttached)
93 Q_DECLARE_PRIVATE(QQuickActionGroupAttached)
94};
95
96QT_END_NAMESPACE
97
98#endif // QQUICKACTIONGROUP_P_H
Groups actions together.