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,13 +74,34 @@ Rectangle {
} }
color: getColors().window color: getColors().window
ListModel { ColumnLayout {
id: apiDataModel anchors.fill: parent
spacing: 0
Rectangle {
id: header
color: getColors().midlight
height: 40
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
spacing: 10
anchors.margins: 5
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 }
}
} }
ListView { ListView {
id: listView id: listView
anchors.fill: parent Layout.fillWidth: true
Layout.fillHeight: true
clip: true clip: true
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
model: apiDataModel model: apiDataModel
@ -93,43 +114,20 @@ Rectangle {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 10 spacing: 10
anchors.margins: 5
Text { Text { text: model.name; color: getColors().text; Layout.fillWidth: true }
text: model.name Text { text: model.key; color: getColors().text; Layout.fillWidth: true }
color: getColors().text Text { text: model.amount; color: getColors().text; Layout.fillWidth: true }
Layout.alignment: Qt.AlignVCenter 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 }
}
}
} }
Text { ListModel {
text: model.key id: apiDataModel
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
Text {
text: model.amount
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
Text {
text: model.start
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
Text {
text: model.end
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
Text {
text: model.group
color: getColors().text
Layout.alignment: Qt.AlignVCenter
}
}
} }
} }
} }