AtlasSwitch
A pill switch with an accent track when on and a knob that slides across with a small overshoot.
Since 1.3.0
A pill switch: an accent track when on, and a knob that slides across with a small overshoot (not under reduced motion). Off shows a visible edge, also when disabled. Use it for a setting that takes effect at once; for a choice that needs confirming, use a check box.
AtlasSwitch is a Qt Quick Controls Switch; checked and toggled work as usual. It draws only the track and the knob: text is not shown, it is only the accessible name. Put the visible label beside it. In a settings list, use SectionRow with showSwitch instead: the row draws the title and the switch.
Example
RowLayout {
AtlasLabel {
text: qsTr("Show hidden files")
Layout.fillWidth: true
}
AtlasSwitch {
text: qsTr("Show hidden files") // the accessible name only
checked: view.value("ShowHidden", false)
onToggled: view.setValue("ShowHidden", checked)
}
}Accessibility
Screen readers say "switch, on" rather than "check box, checked". The accessible name is text.
Note
The label beside the switch is the app's: name the switch with text or Accessible.name.