TG-PlatformPlus/qml/debug/hsvp/common/QxSwitch.qml

29 lines
507 B
QML
Raw Permalink Normal View History

2026-03-02 14:29:58 +08:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item {
width: parent.width/parent.childcount
property var col: ""
property var value: "0"
property var text: "0"
onTextChanged: {
if(text == "1")
sw.checked = true
else
sw.checked = false
}
height: 58
clip: true
Switch {
id: sw
anchors.centerIn: parent
checked: false
onCheckedChanged: parent.value = (checked? "1": "0")
}
}