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
qbuttongroup.h
Go to the documentation of this file.
1
// Copyright (C) 2020 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
QBUTTONGROUP_H
6
#
define
QBUTTONGROUP_H
7
8
#
include
<
QtWidgets
/
qtwidgetsglobal
.
h
>
9
#
include
<
QtCore
/
qobject
.
h
>
10
11
QT_REQUIRE_CONFIG
(
buttongroup
);
12
13
QT_BEGIN_NAMESPACE
14
15
class
QAbstractButton;
16
class
QAbstractButtonPrivate
;
17
class
QButtonGroupPrivate;
18
19
class
Q_WIDGETS_EXPORT
QButtonGroup
:
public
QObject
20
{
21
Q_OBJECT
22
23
Q_PROPERTY(
bool
exclusive READ exclusive WRITE setExclusive)
24
public
:
25
explicit
QButtonGroup(QObject *parent =
nullptr
);
26
~QButtonGroup();
27
28
void
setExclusive(
bool
);
29
bool
exclusive()
const
;
30
31
void
addButton(QAbstractButton *,
int
id = -1);
32
void
removeButton(QAbstractButton *);
33
34
QList<QAbstractButton*> buttons()
const
;
35
36
QAbstractButton * checkedButton()
const
;
37
// no setter on purpose!
38
39
QAbstractButton *button(
int
id)
const
;
40
void
setId(QAbstractButton *button,
int
id);
41
int
id(QAbstractButton *button)
const
;
42
int
checkedId()
const
;
43
44
Q_SIGNALS:
45
void
buttonClicked(QAbstractButton *);
46
void
buttonPressed(QAbstractButton *);
47
void
buttonReleased(QAbstractButton *);
48
void
buttonToggled(QAbstractButton *,
bool
);
49
void
idClicked(
int
);
50
void
idPressed(
int
);
51
void
idReleased(
int
);
52
void
idToggled(
int
,
bool
);
53
54
private
:
55
Q_DISABLE_COPY(QButtonGroup)
56
Q_DECLARE_PRIVATE(QButtonGroup)
57
friend
class
QAbstractButton;
58
friend
class
QAbstractButtonPrivate;
59
};
60
61
QT_END_NAMESPACE
62
63
#
endif
// QBUTTONGROUP_H
QAbstractButtonPrivate
Definition
qabstractbutton_p.h:29
QButtonGroup
The QButtonGroup class provides a container to organize groups of button widgets.
Definition
qbuttongroup.h:20
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(buttongroup)
qtbase
src
widgets
widgets
qbuttongroup.h
Generated on
for Qt by
1.18.0