Choice model settings was added

This commit is contained in:
2023-04-10 19:24:25 +02:00
parent 25e8a3ea79
commit 4a52926be9
31 changed files with 938 additions and 227 deletions

View File

@@ -1,12 +1,63 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import ru.ded.beerlog 1.0
Page {
Label {
anchors.centerIn: parent
title: qsTr("Orders")
text: "Orders"
OrdersViewModel {
id: ordersModel
}
ListView {
id: ordersList
anchors.fill: parent
anchors.margins: 10
model: ordersModel
section.criteria: ViewSection.FullString
section.property: "date"
section.delegate: Label {
text: section
font.bold: true
}
delegate: Column {
width: ordersList.width
height: productsList.heigt
ListView {
id: productsList
width: ordersList.width
height: contentHeight
model: products
header: Label {
padding: 10
font.bold: true
text: "%1 (%2), %3".arg(userName).arg(storeName).arg(time.toLocaleTimeString(Qt.locale(), Locale.ShortFormat))
}
delegate: Label {
width: ordersList.width
leftPadding: 20
text: "%1 x%2, %3".arg(modelData.product).arg(modelData.quantity.toLocaleString(Qt.locale())).arg(modelData.price.toLocaleCurrencyString(Qt.locale()))
}
footer: Label {
padding: 10
font.bold: true
text: qsTr("Summary: %1").arg(amount.toLocaleCurrencyString(Qt.locale()))
}
}
}
}
}