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
qactiongroup.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QACTIONGROUP_H
5#define QACTIONGROUP_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtGui/qaction.h>
9
11
13
15
16class Q_GUI_EXPORT QActionGroup : public QObject
17{
19 Q_DECLARE_PRIVATE(QActionGroup)
20
21 Q_PROPERTY(QActionGroup::ExclusionPolicy exclusionPolicy READ exclusionPolicy WRITE setExclusionPolicy)
22 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
23 Q_PROPERTY(bool visible READ isVisible WRITE setVisible)
24
25public:
26 enum class ExclusionPolicy {
27 None,
28 Exclusive,
29 ExclusiveOptional
30 };
31 Q_ENUM(ExclusionPolicy)
32
33 explicit QActionGroup(QObject *parent);
35
36 QAction *addAction(QAction *a);
37 QAction *addAction(const QString &text);
38 QAction *addAction(const QIcon &icon, const QString &text);
39 void removeAction(QAction *a);
40 QList<QAction*> actions() const;
41 QAction *checkedAction() const;
42
43 bool isExclusive() const;
44 bool isEnabled() const;
45 bool isVisible() const;
46 ExclusionPolicy exclusionPolicy() const;
47
48
49public Q_SLOTS:
50 void setEnabled(bool);
51 inline void setDisabled(bool b) { setEnabled(!b); }
52 void setVisible(bool);
53 void setExclusive(bool);
54 void setExclusionPolicy(ExclusionPolicy policy);
55
59
60private Q_SLOTS:
61 void _q_actionTriggered();
62 void _q_actionHovered();
63 void _q_actionChanged();
64
65protected:
67
68private:
69 Q_DISABLE_COPY(QActionGroup)
70};
71
73
74#endif // QACTIONGROUP_H
The QActionGroup class groups actions together.
void hovered(QAction *)
ExclusionPolicy
This enum specifies the different policies that can be used to control how the group performs exclusi...
void setDisabled(bool b)
This is a convenience function for the \l enabled property, that is useful for signals–slots connecti...
~QActionGroup()
Destroys the action group.
void triggered(QAction *)
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition qaction.h:30
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
Combined button and popup list for selecting options.
@ None
Definition qhash.cpp:531
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define QT_REQUIRE_CONFIG(feature)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
edit isVisible()
QSizePolicy policy