Properties

Detailed Description

CheckDelegate presents an item delegate that can be toggled on (checked) or off (unchecked). Check delegates are typically used to select one or more options from a set of options in a list. For smaller sets of options, or for options that need to be uniquely identifiable, consider using CheckBox instead.

In addition to the checked and unchecked states, there is a third state: partially checked. The partially checked state can be enabled using the tristate property. This state indicates that the regular checked/unchecked state can not be determined; generally because of other states that affect the check delegate. This state is useful when several child nodes are selected in a treeview, for example.

This property holds a callback function that is called to determine the next check state whenever the check delegate is interactively toggled by the user via touch, mouse, or keyboard.

By default, a normal check delegate cycles between Qt.Unchecked and Qt.Checked states, and a tri-state check delegate cycles between Qt.Unchecked, Qt.PartiallyChecked, and Qt.Checked states.

The nextCheckState callback function can override the default behavior. The following example implements a tri-state check delegate that can present a partially checked state depending on external conditions, but never cycles to the partially checked state when interactively toggled by the user.