Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qbuttongroup.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QBUTTONGROUP_H
0006 #define QBUTTONGROUP_H
0007 
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 #include <QtCore/qobject.h>
0010 
0011 QT_REQUIRE_CONFIG(buttongroup);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QAbstractButton;
0016 class QAbstractButtonPrivate;
0017 class QButtonGroupPrivate;
0018 
0019 class Q_WIDGETS_EXPORT QButtonGroup : public QObject
0020 {
0021     Q_OBJECT
0022 
0023     Q_PROPERTY(bool exclusive READ exclusive WRITE setExclusive)
0024 public:
0025     explicit QButtonGroup(QObject *parent = nullptr);
0026     ~QButtonGroup();
0027 
0028     void setExclusive(bool);
0029     bool exclusive() const;
0030 
0031     void addButton(QAbstractButton *, int id = -1);
0032     void removeButton(QAbstractButton *);
0033 
0034     QList<QAbstractButton*> buttons() const;
0035 
0036     QAbstractButton * checkedButton() const;
0037     // no setter on purpose!
0038 
0039     QAbstractButton *button(int id) const;
0040     void setId(QAbstractButton *button, int id);
0041     int id(QAbstractButton *button) const;
0042     int checkedId() const;
0043 
0044 Q_SIGNALS:
0045     void buttonClicked(QAbstractButton *);
0046     void buttonPressed(QAbstractButton *);
0047     void buttonReleased(QAbstractButton *);
0048     void buttonToggled(QAbstractButton *, bool);
0049     void idClicked(int);
0050     void idPressed(int);
0051     void idReleased(int);
0052     void idToggled(int, bool);
0053 
0054 private:
0055     Q_DISABLE_COPY(QButtonGroup)
0056     Q_DECLARE_PRIVATE(QButtonGroup)
0057     friend class QAbstractButton;
0058     friend class QAbstractButtonPrivate;
0059 };
0060 
0061 QT_END_NAMESPACE
0062 
0063 #endif // QBUTTONGROUP_H