Qt Reference Documentation

QML Checkable Element

Implements the functionality for a component that can be enabled or disabled. More...

This element was introduced in Qt Quick Components 1.0.



Detailed Description

Checkable is located in a separate plugin that can be imported with the following statement:

 import Qt.labs.components 1.1

As well as being used with a single component, a Checkable can also be a part of a CheckableGroup where exactly one checkable item in the group can be enabled at a time.

See also CheckableGroup.

Property Documentation

checked : bool

True if this element is checked. Otherwise false.

Note: if the Checkable is a member of an exclusive group, you cannot do 'checked = false' because the logic code of the group does not allow you to "uncheck" a checked item.

enabled : bool

If true, this Checkable is able to be activated in the user interface. If false, then this element cannot be changed by the user.

exclusiveGroup : QtObject

The exclusive group of checkable items that this Checkable item belongs to. In an exclusive group, only one of the Checkable items can be enabled at a time.

See also CheckableGroup and RadioButton.

Method Documentation

Checkable::toggle ()

If the Checkable is a standalone item, this toggles the checked property between true and false.

If the Checkable is a member of an exclusive group, this function does not toggle the checked property. Instead, it sets the checked property to true and the checked property for the other members of the exclusive group will be set to false.