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 color: getColors().window
ListModel { ColumnLayout {
id: apiDataModel
}
ListView {
id: listView
anchors.fill: parent anchors.fill: parent
clip: true spacing: 0
boundsBehavior: Flickable.StopAtBounds
model: apiDataModel
delegate: Rectangle { Rectangle {
width: listView.width id: header
height: 50 color: getColors().midlight
color: getColors().button height: 40
Layout.fillWidth: true
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 10 spacing: 10
anchors.margins: 5
Text { Text { text: qsTr("Name"); color: getColors().text; Layout.fillWidth: true }
text: model.name Text { text: qsTr("Key"); color: getColors().text; Layout.fillWidth: true }
color: getColors().text Text { text: qsTr("Amount"); color: getColors().text; Layout.fillWidth: true }
Layout.alignment: Qt.AlignVCenter 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 { ListView {
text: model.key id: listView
color: getColors().text Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter Layout.fillHeight: true
} clip: true
boundsBehavior: Flickable.StopAtBounds
model: apiDataModel
Text { delegate: Rectangle {
text: model.amount width: listView.width
color: getColors().text height: 50
Layout.alignment: Qt.AlignVCenter color: getColors().button
}
Text { RowLayout {
text: model.start anchors.fill: parent
color: getColors().text spacing: 10
Layout.alignment: Qt.AlignVCenter anchors.margins: 5
}
Text { Text { text: model.name; color: getColors().text; Layout.fillWidth: true }
text: model.end 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 {
text: model.group
color: getColors().text
Layout.alignment: Qt.AlignVCenter
} }
} }
} }
ListModel {
id: apiDataModel
}
} }
} }