RestsView.qml 792 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import QtQuick 2.15
  2. import QtQuick.Controls 2.15
  3. import ru.ded.beerlog 1.0
  4. Page {
  5. title: qsTr("Rests")
  6. RestsViewModel {
  7. id: restsModel
  8. }
  9. ListView {
  10. id: restsList
  11. anchors.fill: parent
  12. anchors.margins: 10
  13. model: restsModel.products
  14. delegate: ItemDelegate {
  15. width: restsList.width
  16. text: modelData.title
  17. TextField {
  18. anchors.right: parent.right
  19. validator: DoubleValidator {
  20. bottom: 0.0
  21. top: 1000.0
  22. }
  23. height: parent.height
  24. text: modelData.rest
  25. onEditingFinished: restsModel.setProductRest(modelData.productId, text)
  26. }
  27. }
  28. }
  29. }