ControlSwitch.qml 512 B

1234567891011121314151617181920212223242526
  1. // 控制开关行组件
  2. import QtQuick
  3. import Felgo 4.0
  4. Row {
  5. id: root
  6. property string label: ""
  7. property alias switchId: controlSwitch
  8. signal toggle
  9. spacing: 10
  10. width: parent ? parent.width : 200
  11. AppText {
  12. text: root.label
  13. fontSize: 14
  14. color: app.fontColor
  15. anchors.verticalCenter: parent.verticalCenter
  16. }
  17. AppSwitch {
  18. id: controlSwitch
  19. anchors.verticalCenter: parent.verticalCenter
  20. onToggled: root.toggle()
  21. }
  22. }