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

29 lines
507 B
QML

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")
}
}