Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Mutually-exclusive group of checkable buttons. More...
Additional Inherited Members | |
Public Types inherited from QObjectPrivate | |
typedef void(*) | StaticMetaCallFunction(QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData> |
Mutually-exclusive group of checkable buttons.
\qmltype ButtonGroup \inherits QtObject
! \nativetype QQuickButtonGroup \inqmlmodule QtQuick.Controls
ButtonGroup is a non-visual, mutually exclusive group of buttons. It is used with controls such as RadioButton, where only one of the options can be selected at a time.
The most straight-forward way to use ButtonGroup is to assign a list of buttons. For example, the list of children of a \l{Item Positioners}{positioner} or a \l{Qt Quick Layouts}{layout} that manages a group of mutually exclusive buttons.
Mutually exclusive buttons do not always share the same parent item, or the parent layout may sometimes contain items that should not be included in the button group. Such cases are best handled using the \l group attached property.
Another option is to filter the list of children. This is especially handy if you're using a repeater to populate it, since the repeater will also be a child of the parent layout:
More advanced use cases can be handled using the addButton()
and removeButton()
methods.
\qmlsignal QtQuick.Controls::ButtonGroup::clicked(AbstractButton button)
This signal is emitted when a button in the group has been clicked.
This signal is convenient for implementing a common signal handler for all buttons in the same group.
Definition at line 144 of file qquickbuttongroup.cpp.
void QQuickButtonGroupPrivate::_q_updateCurrent | ( | ) |
Definition at line 192 of file qquickbuttongroup.cpp.
References exclusive, and updateCheckState().
void QQuickButtonGroupPrivate::_q_updateCurrent | ( | ) |
void QQuickButtonGroupPrivate::buttonClicked | ( | ) |
Definition at line 184 of file qquickbuttongroup.cpp.
void QQuickButtonGroupPrivate::buttonClicked | ( | ) |
|
static |
Definition at line 230 of file qquickbuttongroup.cpp.
|
static |
|
static |
Definition at line 242 of file qquickbuttongroup.cpp.
|
static |
|
static |
Definition at line 248 of file qquickbuttongroup.cpp.
|
static |
|
static |
Definition at line 236 of file qquickbuttongroup.cpp.
|
static |
void QQuickButtonGroupPrivate::clear | ( | ) |
Definition at line 168 of file qquickbuttongroup.cpp.
void QQuickButtonGroupPrivate::clear | ( | ) |
void QQuickButtonGroupPrivate::setCheckState | ( | Qt::CheckState | state | ) |
Definition at line 220 of file qquickbuttongroup.cpp.
void QQuickButtonGroupPrivate::setCheckState | ( | Qt::CheckState | state | ) |
void QQuickButtonGroupPrivate::updateCheckState | ( | ) |
Definition at line 205 of file qquickbuttongroup.cpp.
References complete, and settingCheckState.
Referenced by _q_updateCurrent().
void QQuickButtonGroupPrivate::updateCheckState | ( | ) |
QList< QQuickAbstractButton * > QQuickButtonGroupPrivate::buttons |
Definition at line 165 of file qquickbuttongroup.cpp.
QPointer< QQuickAbstractButton > QQuickButtonGroupPrivate::checkedButton |
Definition at line 164 of file qquickbuttongroup.cpp.
Qt::CheckState QQuickButtonGroupPrivate::checkState = Qt::Unchecked |
Definition at line 163 of file qquickbuttongroup.cpp.
bool QQuickButtonGroupPrivate::complete = true |
Definition at line 160 of file qquickbuttongroup.cpp.
Referenced by updateCheckState().
bool QQuickButtonGroupPrivate::exclusive = true |
Definition at line 161 of file qquickbuttongroup.cpp.
Referenced by _q_updateCurrent().
bool QQuickButtonGroupPrivate::settingCheckState = false |
Definition at line 162 of file qquickbuttongroup.cpp.
Referenced by updateCheckState().