CheckBox

component fbx.ui.control.CheckBox

CheckBox is a clickable widget. It has a checked state inherited from fbx.ui.base.Checkable. Optionnally, a fbx.ui.control.CheckableGroup may be assigned to it in order to become a radio button.

../../../_images/checkbox_unselected.png

An unselected checkbox:

CheckBox {
    text: "b"
}
../../../_images/checkbox_selected.png

A selected checkbox:

CheckBox {
    text: "b"
    checked: true
}
property text

Text string printed on the check box.

property hovered

Whether check box is currently hovered by a mouse.

property pressed

Whether check box is currently pressed, either by a mouse or a keyboard press.

property enabled

Whether check box accepts user interaction. If this is set to false, the check box appears grayed-out and does not react on hovering.

../../../_images/checkbox_hovered.png

A hovered checkbox

../../../_images/checkbox_inactive.png

A non-enabled checkbox

signal clicked()

Signal raised when the check box gets clicked, either with a mouse or with keyboard.

property value

A variant value assigned to this check box. If check box is in a CheckableGroup, this value is reflected on fbx.ui.control.CheckableGroup.value when selected.

property exclusiveGroup

A reference to a fbx.ui.control.CheckableGroup used for radio button exclusive selection checking.

Setting this property to null is enough to get out of the group.

../../../_images/radio_group.png

A set of radio buttons. These are CheckBoxes with an exclusiveGroup assigned. Only one in the group may be assigned. In the group shown, “e” is not enabled.

CheckableGroup {
    id: group

    onValueChanged: console.log("Selected value is", value);
}

CheckBox {
    exclusiveGroup: group
    text: "a"
    value: "a"
}

CheckBox {
    exclusiveGroup: group
    text: "b"
    value: "b"
}

CheckBox {
    exclusiveGroup: group
    text: "c"
    value: "c"
}

CheckBox {
    exclusiveGroup: group
    text: "d"
    value: "d"
}

CheckBox {
    exclusiveGroup: group
    text: "e"
    value: "e"
}