Skip to content

Tristate Switch #93

@christophe-thiery-fw

Description

@christophe-thiery-fw

QCheckBox have a tristate property, allowing a third state called "partially checked" that can be used for various purposes, e.g. an "unspecified" value, or a parent item in a tree view where children do not all have the same boolean value.
If we see Switch as a modern version of a checkbox, it would make sense to also make them support tristate.

Add a boolean property "tristate" to Switch, false by default.
When tristate is true, change Switch to the following:

  • Switch in state "checked": no change: show a white circle on the right, with a background in primary color
  • Switch in state "unchecked": no change: show a white circle on the left, with a background in the default background color
  • Switch in state "partically checked": show a smaller white circle in the middle, with a background in the default background color (same background as "unchecked")

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions