Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QACTIONGROUP_H
6
#
define
QACTIONGROUP_H
7
8
#
include
<
QtGui
/
qtguiglobal
.
h
>
9
#
include
<
QtGui
/
qaction
.
h
>
10
11
QT_REQUIRE_CONFIG
(
action
);
12
13
QT_BEGIN_NAMESPACE
14
15
class
QActionGroupPrivate;
16
17
class
Q_GUI_EXPORT
QActionGroup
:
public
QObject
18
{
19
Q_OBJECT
20
Q_DECLARE_PRIVATE(QActionGroup)
21
22
Q_PROPERTY(QActionGroup::ExclusionPolicy exclusionPolicy READ exclusionPolicy WRITE setExclusionPolicy)
23
Q_PROPERTY(
bool
enabled READ isEnabled WRITE setEnabled)
24
Q_PROPERTY(
bool
visible READ isVisible WRITE setVisible)
25
26
public
:
27
enum
class
ExclusionPolicy {
28
None,
29
Exclusive,
30
ExclusiveOptional
31
};
32
Q_ENUM(ExclusionPolicy)
33
34
explicit
QActionGroup(QObject *parent);
35
~QActionGroup();
36
37
QAction *addAction(QAction *a);
38
QAction *addAction(
const
QString &text);
39
QAction *addAction(
const
QIcon &icon,
const
QString &text);
40
void
removeAction(QAction *a);
41
QList<QAction*> actions()
const
;
42
QAction *checkedAction()
const
;
43
44
bool
isExclusive()
const
;
45
bool
isEnabled()
const
;
46
bool
isVisible()
const
;
47
ExclusionPolicy exclusionPolicy()
const
;
48
49
50
public
Q_SLOTS:
51
void
setEnabled(
bool
);
52
inline
void
setDisabled(
bool
b) { setEnabled(!b); }
53
void
setVisible(
bool
);
54
void
setExclusive(
bool
);
55
void
setExclusionPolicy(ExclusionPolicy policy);
56
57
Q_SIGNALS:
58
void
triggered(QAction *);
59
void
hovered(QAction *);
60
61
private
Q_SLOTS:
62
void
_q_actionTriggered();
63
void
_q_actionHovered();
64
void
_q_actionChanged();
65
66
protected
:
67
QActionGroup(QActionGroupPrivate &dd, QObject *parent);
68
69
private
:
70
Q_DISABLE_COPY(QActionGroup)
71
};
72
73
QT_END_NAMESPACE
74
75
#
endif
// QACTIONGROUP_H
QActionGroup
The QActionGroup class groups actions together.
Definition
qactiongroup.h:18
QAction
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition
qaction.h:31
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(action)
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QAPP_CHECK
#define QAPP_CHECK(functionName)
Definition
qaction.cpp:19
qt_strippedText
static QString qt_strippedText(QString s)
Definition
qaction.cpp:32
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(animation)
operator<<
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition
qdir.cpp:2620
qtbase
src
gui
kernel
qactiongroup.h
Generated on
for Qt by
1.18.0