native: add table header

This commit is contained in:
jopejoe1 2024-07-11 22:02:36 +02:00
parent e2ca009d35
commit 8a6ba829c0

View file

@ -74,63 +74,61 @@ Rectangle {
}
color: getColors().window
ListModel {
id: apiDataModel
}
ListView {
id: listView
ColumnLayout {
anchors.fill: parent
clip: true
boundsBehavior: Flickable.StopAtBounds
model: apiDataModel
spacing: 0
delegate: Rectangle {
width: listView.width
height: 50
color: getColors().button
Rectangle {
id: header
color: getColors().midlight
height: 40
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
spacing: 10
anchors.margins: 5
Text {
text: model.name
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
Text { text: qsTr("Name"); color: getColors().text; Layout.fillWidth: true }
Text { text: qsTr("Key"); color: getColors().text; Layout.fillWidth: true }
Text { text: qsTr("Amount"); color: getColors().text; Layout.fillWidth: true }
Text { text: qsTr("Start"); color: getColors().text; Layout.fillWidth: true }
Text { text: qsTr("End"); color: getColors().text; Layout.fillWidth: true }
Text { text: qsTr("Group"); color: getColors().text; Layout.fillWidth: true }
}
}
Text {
text: model.key
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
ListView {
id: listView
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
boundsBehavior: Flickable.StopAtBounds
model: apiDataModel
Text {
text: model.amount
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
delegate: Rectangle {
width: listView.width
height: 50
color: getColors().button
Text {
text: model.start
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
RowLayout {
anchors.fill: parent
spacing: 10
anchors.margins: 5
Text {
text: model.end
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
Text {
text: model.group
color: getColors().text
Layout.alignment: Qt.AlignVCenter
Text { text: model.name; color: getColors().text; Layout.fillWidth: true }
Text { text: model.key; color: getColors().text; Layout.fillWidth: true }
Text { text: model.amount; color: getColors().text; Layout.fillWidth: true }
Text { text: model.start; color: getColors().text; Layout.fillWidth: true }
Text { text: model.end; color: getColors().text; Layout.fillWidth: true }
Text { text: model.group; color: getColors().text; Layout.fillWidth: true }
}
}
}
ListModel {
id: apiDataModel
}
}
}