[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
[846] | 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[561] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
[2] | 6 | **
|
---|
| 7 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
| 8 | **
|
---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 10 | ** Commercial Usage
|
---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 14 | ** a written agreement between you and Nokia.
|
---|
| 15 | **
|
---|
| 16 | ** GNU Lesser General Public License Usage
|
---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 20 | ** packaging of this file. Please review the following information to
|
---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 23 | **
|
---|
[561] | 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
[2] | 27 | **
|
---|
| 28 | ** GNU General Public License Usage
|
---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 32 | ** packaging of this file. Please review the following information to
|
---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 35 | **
|
---|
[561] | 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at [email protected].
|
---|
[2] | 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | /*!
|
---|
| 45 | \class QButtonGroup
|
---|
| 46 | \brief The QButtonGroup class provides a container to organize groups of
|
---|
| 47 | button widgets.
|
---|
| 48 |
|
---|
| 49 | \ingroup organizers
|
---|
| 50 | \ingroup geomanagement
|
---|
| 51 |
|
---|
| 52 | QButtonGroup provides an abstract container into which button widgets can
|
---|
| 53 | be placed. It does not provide a visual representation of this container
|
---|
| 54 | (see QGroupBox for a container widget), but instead manages the states of
|
---|
| 55 | each of the buttons in the group.
|
---|
| 56 |
|
---|
| 57 | An \l {QButtonGroup::exclusive} {exclusive} button group switches
|
---|
| 58 | off all checkable (toggle) buttons except the one that was
|
---|
| 59 | clicked. By default, a button group is exclusive. The buttons in a
|
---|
| 60 | button group are usually checkable QPushButton's, \l{QCheckBox}es
|
---|
| 61 | (normally for non-exclusive button groups), or \l{QRadioButton}s.
|
---|
| 62 | If you create an exclusive button group, you should ensure that
|
---|
| 63 | one of the buttons in the group is initially checked; otherwise,
|
---|
| 64 | the group will initially be in a state where no buttons are
|
---|
| 65 | checked.
|
---|
| 66 |
|
---|
| 67 | A button is added to the group with addButton(). It can be removed
|
---|
| 68 | from the group with removeButton(). If the group is exclusive, the
|
---|
| 69 | currently checked button is available as checkedButton(). If a
|
---|
| 70 | button is clicked the buttonClicked() signal is emitted. For a
|
---|
| 71 | checkable button in an exclusive group this means that the button
|
---|
| 72 | was checked. The list of buttons in the group is returned by
|
---|
| 73 | buttons().
|
---|
| 74 |
|
---|
| 75 | In addition, QButtonGroup can map between integers and buttons.
|
---|
| 76 | You can assign an integer id to a button with setId(), and
|
---|
| 77 | retrieve it with id(). The id of the currently checked button is
|
---|
| 78 | available with checkedId(), and there is an overloaded signal
|
---|
| 79 | buttonClicked() which emits the id of the button. The id \c {-1}
|
---|
| 80 | is reserved by QButtonGroup to mean "no such button". The purpose
|
---|
| 81 | of the mapping mechanism is to simplify the representation of enum
|
---|
| 82 | values in a user interface.
|
---|
| 83 |
|
---|
| 84 | \sa QGroupBox QPushButton, QCheckBox, QRadioButton
|
---|
| 85 | */
|
---|
| 86 |
|
---|
| 87 | /*!
|
---|
| 88 | \fn QButtonGroup::QButtonGroup(QObject *parent)
|
---|
| 89 |
|
---|
| 90 | Constructs a new, empty button group with the given \a parent.
|
---|
| 91 |
|
---|
| 92 | \sa addButton() setExclusive()
|
---|
| 93 | */
|
---|
| 94 |
|
---|
| 95 | /*!
|
---|
| 96 | \fn QButtonGroup::~QButtonGroup()
|
---|
| 97 |
|
---|
| 98 | Destroys the button group.
|
---|
| 99 | */
|
---|
| 100 |
|
---|
| 101 | /*!
|
---|
| 102 | \property QButtonGroup::exclusive
|
---|
| 103 | \brief whether the button group is exclusive
|
---|
| 104 |
|
---|
| 105 | If this property is true then only one button in the group can be checked
|
---|
| 106 | at any given time. The user can click on any button to check it, and that
|
---|
| 107 | button will replace the existing one as the checked button in the group.
|
---|
| 108 |
|
---|
| 109 | In an exclusive group, the user cannot uncheck the currently checked button
|
---|
| 110 | by clicking on it; instead, another button in the group must be clicked
|
---|
| 111 | to set the new checked button for that group.
|
---|
| 112 |
|
---|
| 113 | By default, this property is true.
|
---|
| 114 | */
|
---|
| 115 |
|
---|
| 116 | /*!
|
---|
| 117 | \fn void QButtonGroup::buttonClicked(QAbstractButton *button)
|
---|
| 118 |
|
---|
| 119 | This signal is emitted when the given \a button is clicked. A
|
---|
| 120 | button is clicked when it is first pressed and then released, when
|
---|
| 121 | its shortcut key is typed, or programmatically when
|
---|
| 122 | QAbstractButton::click() or QAbstractButton::animateClick() is
|
---|
| 123 | called.
|
---|
| 124 |
|
---|
| 125 |
|
---|
| 126 | \sa checkedButton(), QAbstractButton::clicked()
|
---|
| 127 | */
|
---|
| 128 |
|
---|
| 129 | /*!
|
---|
| 130 | \fn void QButtonGroup::buttonClicked(int id)
|
---|
| 131 |
|
---|
| 132 | This signal is emitted when a button with the given \a id is
|
---|
| 133 | clicked.
|
---|
| 134 |
|
---|
| 135 | \sa checkedButton(), QAbstractButton::clicked()
|
---|
| 136 | */
|
---|
| 137 |
|
---|
| 138 | /*!
|
---|
| 139 | \fn void QButtonGroup::buttonPressed(QAbstractButton *button)
|
---|
| 140 | \since 4.2
|
---|
| 141 |
|
---|
| 142 | This signal is emitted when the given \a button is pressed down.
|
---|
| 143 |
|
---|
| 144 | \sa QAbstractButton::pressed()
|
---|
| 145 | */
|
---|
| 146 |
|
---|
| 147 | /*!
|
---|
| 148 | \fn void QButtonGroup::buttonPressed(int id)
|
---|
| 149 | \since 4.2
|
---|
| 150 |
|
---|
| 151 | This signal is emitted when a button with the given \a id is
|
---|
| 152 | pressed down.
|
---|
| 153 |
|
---|
| 154 | \sa QAbstractButton::pressed()
|
---|
| 155 | */
|
---|
| |
---|