BoolInput

A labeled editor for one boolean parameter, with a reset button.

Declared in src/libs/libwidgets/components/BoolInput.hpp
Inherits QWidget
Group widgets

Detailed description

BoolInput builds its row from a ParameterInputConfig: a label, a checkable button that shows the value as "Enabled" or "Disabled", and a button that resets the value to the configured default.

valueChanged() reports each change of the toggle, from a click and from a reset. setValue() changes the value without a signal.

An item delegate that paints a boolean cell with no widget calls the static paintToggle(), so the cell looks the same as the live toggle.

See also IntInput.

Member function documentation

paintToggle

[static] void BoolInput::paintToggle(QPainter *painter, const QRect &rect, bool checked, const QStyleOption &base, const QStyle *style, const QWidget *widget = nullptr)

Paints the toggle look of checked into rect of painter through style.

The option is filled the way QPushButton::initStyleOption() fills it for a checkable, non-flat, non-default button that is not pressed, so the pixels match the live toggle (config-ui §CFGV-5a). base supplies the palette, the enabled and focus state and the direction. The function gives widget to each call into the style. It can be null.

toggleText

[static] QString BoolInput::toggleText(bool checked)

Returns the text of the toggle for checked.

In this section