QToggleSwitch
- An on/off switch for Qt
Licensed under the Apache License 2.0
Inherits QSlider
.
- Python
- C++ (incomplete; do not use)
(Requires PyQt5
)
A demo written in Python is included. Run demo/QToggleSwitch_demo.py
.
import QToggleSwitch
toggleSwitch = QToggleSwitch.QToggleSwitch(default=0)
#include "QToggleSwitch.hpp"
QToggleSwitch *toggleSwitch = new QToggleSwitch();
Default value of switch is 0 (off). This can be changed by passing the
default=
argument on intitialization. This argument accepts
0
for off and 1
for on.
NOTE: Not yet supported in C++ version.
toggled
- Emitted when switch's value changesswitchedOn
- Emitted when value becomes 1 (on)switchedOff
- Emitted when value becomes 0 (off)
toggle()
- Programmatically switch on/off
isOn()
(Boolean
) - ReturnsTrue
if on; else returnsFalse