native: add table header
This commit is contained in:
parent
e2ca009d35
commit
8a6ba829c0
1 changed files with 41 additions and 43 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue