RestsView.qml 846 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. inputMethodHints: Qt.ImhPreferNumbers
  26. onEditingFinished: restsModel.setProductRest(modelData.productId, text)
  27. }
  28. }
  29. }
  30. }