Rests view was added

This commit is contained in:
2023-04-13 16:02:28 +02:00
parent f0b38d8fda
commit fc1d96437f
9 changed files with 180 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ Page {
RowLayout {
anchors.fill: parent
anchors.margins: 10
ListView {
id: productsList

43
qml/Views/RestsView.qml Normal file
View File

@@ -0,0 +1,43 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import ru.ded.beerlog 1.0
Page {
title: qsTr("Rests")
RestsViewModel {
id: restsModel
}
ListView {
id: restsList
anchors.fill: parent
anchors.margins: 10
model: restsModel.products
delegate: ItemDelegate {
width: restsList.width
text: modelData.title
TextField {
anchors.right: parent.right
validator: DoubleValidator {
bottom: 0.0
top: 1000.0
}
height: parent.height
text: modelData.rest
onEditingFinished: restsModel.setProductRest(modelData.productId, text)
}
}
}
}

View File

@@ -83,6 +83,7 @@ ApplicationWindow {
readonly property var actions: {
"orders": () => { stackView.openPage("Views/OrdersView.qml") },
"rests": () => { stackView.openPage("Views/RestsView.qml") },
"settings": () => { stackView.openPage("Views/SettingsView.qml") },
"quit": () => { Qt.quit() }
}
@@ -99,6 +100,10 @@ ApplicationWindow {
title: qsTr("Orders")
action: "orders"
}
ListElement {
title: qsTr("Rests")
action: "rests"
}
ListElement {
title: qsTr("Settings")
action: "settings"

View File

@@ -6,5 +6,6 @@
<file>Views/OrdersView.qml</file>
<file>Views/SettingsView.qml</file>
<file>Views/ProductsView.qml</file>
<file>Views/RestsView.qml</file>
</qresource>
</RCC>