diff options
| -rw-r--r-- | src/controls/AbstractCheckable.qml | 35 | ||||
| -rw-r--r-- | src/controls/CheckBox.qml | 5 |
2 files changed, 24 insertions, 16 deletions
diff --git a/src/controls/AbstractCheckable.qml b/src/controls/AbstractCheckable.qml index 18ca6bf67..9bf5342ef 100644 --- a/src/controls/AbstractCheckable.qml +++ b/src/controls/AbstractCheckable.qml @@ -46,55 +46,58 @@ import QtQuick.Controls.Private 1.0 \qmltype AbstractCheckable \inqmlmodule QtQuick.Controls 1.0 \ingroup controls - \brief An abstract representation of a checkable control + \brief An abstract representation of a checkable control with a label \qmlabstract + + A checkable control is one that has two states: checked (on) and + unchecked (off). AbstractCheckable encapsulates the basic behavior and + states that are required by checkable controls. + + Examples of checkable controls are RadioButton and + CheckBox. CheckBox extends AbstractCheckable's behavior by adding a third + state: partially checked. */ Control { id: abstractCheckable /*! - Emitted whenever the radio button is clicked. + Emitted whenever the control is clicked. */ signal clicked /*! - \qmlproperty bool RadioButton::pressed + \qmlproperty bool AbstractCheckable::pressed - This property is \c true if the radio button is pressed. + This property is \c true if the control is pressed. Set this property to manually invoke a mouse click. */ readonly property alias pressed: mouseArea.effectivePressed /*! - This property is \c true if the radio button is checked, and determines - whether \l checkedState is \c Qt.Checked or \c Qt.UnChecked. - - If \l partiallyCheckedEnabled is \c true, this property will be - \c false. + This property is \c true if the control is checked. */ property bool checked: false /*! - \qmlproperty bool RadioButton::containsMouse + \qmlproperty bool AbstractCheckable::containsMouse - This property is \c true if the radio button currently contains the + This property is \c true if the control currently contains the mouse cursor. */ readonly property alias containsMouse: mouseArea.containsMouse /*! - This property is \c true if the radio button takes the focus when it is + This property is \c true if the control takes the focus when it is pressed; \l{QQuickItem::forceActiveFocus()}{forceActiveFocus()} will be - called on the radio button. + called on the control. */ property bool activeFocusOnPress: false /*! - \qmlproperty ExclusiveGroup RadioButton::exclusiveGroup + \qmlproperty ExclusiveGroup AbstractCheckable::exclusiveGroup - This property stores the ExclusiveGroup that the radio button belongs - to. + This property stores the ExclusiveGroup that the control belongs to. */ property ExclusiveGroup exclusiveGroup: null diff --git a/src/controls/CheckBox.qml b/src/controls/CheckBox.qml index 712ddab7b..8d693c709 100644 --- a/src/controls/CheckBox.qml +++ b/src/controls/CheckBox.qml @@ -84,6 +84,9 @@ AbstractCheckable { \c Qt.Checked - The checkbox is checked. \c Qt.PartiallyChecked - The checkbox is in a partially checked (or "mixed") state. + + The \l checked property also determines whether this property is + \c Qt.Checked or \c Qt.UnChecked, and vice versa. */ property int checkedState: checked ? Qt.Checked : Qt.Unchecked @@ -97,6 +100,8 @@ AbstractCheckable { Setting \l checkedState to \c Qt.PartiallyChecked will implicitly set this property to \c true. + If this property is \c true, \l checked will be \c false. + By default, this property is \c false. */ property bool partiallyCheckedEnabled: false |
