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
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
4#ifndef QBUTTONGROUP_H
5#define QBUTTONGROUP_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtCore/qobject.h>
9
10QT_REQUIRE_CONFIG(buttongroup);
11
13
14class QAbstractButton;
17
18class Q_WIDGETS_EXPORT QButtonGroup : public QObject
19{
21
22 Q_PROPERTY(bool exclusive READ exclusive WRITE setExclusive)
23public:
24 explicit QButtonGroup(QObject *parent = nullptr);
26
27 void setExclusive(bool);
28 bool exclusive() const;
29
30 void addButton(QAbstractButton *, int id = -1);
31 void removeButton(QAbstractButton *);
32
33 QList<QAbstractButton*> buttons() const;
34
35 QAbstractButton * checkedButton() const;
36 // no setter on purpose!
37
38 QAbstractButton *button(int id) const;
39 void setId(QAbstractButton *button, int id);
40 int id(QAbstractButton *button) const;
41 int checkedId() const;
42
48 void idClicked(int);
49 void idPressed(int);
50 void idReleased(int);
51 void idToggled(int, bool);
52
53private:
54 Q_DISABLE_COPY(QButtonGroup)
55 Q_DECLARE_PRIVATE(QButtonGroup)
56 friend class QAbstractButton;
58};
59
61
62#endif // QBUTTONGROUP_H
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
The QButtonGroup class provides a container to organize groups of button widgets.
void idPressed(int)
void buttonToggled(QAbstractButton *, bool)
void idReleased(int)
void buttonClicked(QAbstractButton *)
This signal is emitted when the given button is clicked.
void idToggled(int, bool)
void buttonPressed(QAbstractButton *)
void buttonReleased(QAbstractButton *)
void idClicked(int)
\inmodule QtCore
Definition qobject.h:103
QPushButton * button
[2]
employee setId(37)
Combined button and popup list for selecting options.
GLenum GLuint id
[7]
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS