Toggle Switch in Qt

后端 未结 10 2203
臣服心动
臣服心动 2020-12-12 17:31

I am trying to use an element which is the equivalent of Android Switches in Qt. I have found a ToggleSwitch in QML, but nothing in the actual C++ Qt libs. Am I just missing

10条回答
  •  星月不相逢
    2020-12-12 17:54

    Davita is right in his answer where it concerns checkboxes. If you are looking for something similar to third example however (the on/off switches) you could simply use two QPushButtons for that and set them to be checkable. Make them autoexclusive at the same time, and you should be good to go.

    With a bit of visual styling using a stylesheet you should be able to get close, if not spot on.

提交回复
热议问题