ServiceForm.qml 756 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import QtQuick 2.0
  2. import QtQuick.Controls 2.2
  3. Page {
  4. id: root
  5. title: qsTr("Service")
  6. ListView {
  7. model: lightsModel.channelsCount
  8. anchors.fill: parent
  9. delegate: Row {
  10. spacing: 4
  11. anchors.horizontalCenter: parent.horizontalCenter
  12. Button {
  13. width: 160
  14. text: qsTr("Bind channel %1").arg(index)
  15. onClicked: {
  16. lightsModel.bindChannel(index)
  17. }
  18. }
  19. Button {
  20. width: 160
  21. text: qsTr("Unbind channel %1").arg(index)
  22. onClicked: {
  23. lightsModel.unbindChannel(index)
  24. }
  25. }
  26. }
  27. }
  28. }