CheckBox QML Type
A checkbox with a text label. More...
|Import Statement:||import QtQuick.Controls 1.4|
- activeFocusOnPress : bool
- checked : bool
- checkedState : int
- exclusiveGroup : ExclusiveGroup
- hovered : bool
- partiallyCheckedEnabled : bool
- pressed : bool
- style : Component
- text : string
- tooltip : string
A CheckBox is an option button that can be toggled on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others.
The state of the checkbox can be set with the checked property.
In addition to the checked and unchecked states, there is a third state: partially checked. This state indicates that the regular checked/unchecked state can not be determined; generally because of other states that affect the checkbox. This state is useful when several child nodes are selected in a treeview, for example.
The partially checked state can be made available to the user by setting partiallyCheckedEnabled to
true, or set directly by setting checkedState to
Qt.PartiallyChecked. checkedState behaves identically to checked when partiallyCheckedEnabled is
false; setting one will appropriately set the other.
The label is shown next to the checkbox, and you can set the label text using its text property.
This property is
true if the control takes the focus when it is pressed; forceActiveFocus() will be called on the control.
This property indicates the current checked state of the checkbox.
Qt.UnChecked - The checkbox is not checked (default).
Qt.Checked - The checkbox is checked.
Qt.PartiallyChecked - The checkbox is in a partially checked (or "mixed") state.
The checked property also determines whether this property is
Qt.UnChecked, and vice versa.
exclusiveGroup : ExclusiveGroup
This property stores the ExclusiveGroup that the control belongs to.
This property determines whether the
Qt.PartiallyChecked state is available.
A checkbox may be in a partially checked state when the regular checked state can not be determined.
Setting checkedState to
Qt.PartiallyChecked will implicitly set this property to
If this property is
true, checked will be
By default, this property is
This property is
true if the control is being pressed. Set this property to manually invoke a mouse click.
style : Component
The style Component for this control.
See also Qt Quick Controls Styles QML Types.
This property holds the button tooltip.
This QML property was introduced in QtQuick.Controls 1.7.
© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.