Implement Quick Filters

This commit is contained in:
Yuri Becker
2025-03-21 13:25:03 +01:00
parent 83f64f9af8
commit 721232a975
16 changed files with 196 additions and 238 deletions

View File

@@ -3,78 +3,69 @@ import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
ColumnLayout {
function viewCriterion(criterion) {
business_model.viewCriterion(criterion.text);
}
anchors.fill: parent
Component.onCompleted: customersStack.pop()
SearchBar {
id: searchBar
RowLayout {
Layout.fillWidth: true
Layout.horizontalStretchFactor: 1
spacing: Dimensions.l
anchors.margins: 9
}
SearchBar {
}
Button {
id: addCustomer
QuickFilter {
onSelectedChanged: (name) => {
business_model.viewCriterion(name)
}
anchors.right: parent.right
icon.source: "qrc:/images/PlusCircle.svg"
text: qsTr("Kunde hinzufügen")
model: ListModel {
ListElement {
name: "Alle"
text: qsTr("Alle")
selected: true
}
ListElement {
name: "showProvider"
text: qsTr("Interessent")
selected: false
}
ListElement {
name: "showClientele"
text: qsTr("Kunde")
selected: false
}
ListElement {
name: "showProvider"
text: qsTr("Lieferant")
selected: false
}
ListElement {
name: "showFinished"
text: qsTr("Erledigt")
selected: false
}
}
}
Button {
id: addCustomer
onClicked: appLoader.source = "AddCustomer.qml"
Layout.alignment: Qt.AlignRight
icon.source: "qrc:/images/PlusCircle.svg"
text: qsTr("Kunde Hinzufügen")
onClicked: appLoader.source = "AddCustomer.qml"
}
}
ColumnLayout {
id: tableColumn
clip: true
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
top: searchBar.bottom
}
RowLayout {
id: sortView
RadioButton {
id: showAll
checked: true
text: qsTr("Alle")
onClicked: viewCriterion(showAll)
}
RadioButton {
id: showInterested
text: qsTr("Interessent")
onClicked: viewCriterion(showInterested)
}
RadioButton {
id: showClientele
text: qsTr("Kunden")
onClicked: viewCriterion(showClientele)
}
RadioButton {
id: showProvider
text: qsTr("Lieferant")
onClicked: viewCriterion(showProvider)
}
RadioButton {
id: showFinished
text: qsTr("Erledigt")
onClicked: viewCriterion(showFinished)
}
}
HorizontalHeaderView {
id: horizontalHeader
@@ -107,7 +98,6 @@ Item {
property real newWidth: 0
Layout.fillHeight: true
//height: tableColumn.height - (sortView.height + horizontalHeader.height)
Layout.fillWidth: true
alternatingRows: true
columnSpacing: 1