User header instead of columnlayout to better add widgets to top of listview.
This commit is contained in:
@@ -272,62 +272,64 @@ Kirigami.ApplicationWindow {
|
|||||||
router.pushRoute({"route": "addrecord", "data": serviceId});
|
router.pushRoute({"route": "addrecord", "data": serviceId});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*Layouts.ColumnLayout {
|
ListView {
|
||||||
anchors.fill: parent
|
id: serviceView
|
||||||
Kirigami.InlineMessage {
|
Layouts.Layout.fillHeight: true
|
||||||
Layouts.Layout.fillWidth: true
|
Layouts.Layout.fillWidth: true
|
||||||
Layouts.Layout.leftMargin: 10
|
model: recordModel
|
||||||
Layouts.Layout.rightMargin: 10
|
headerPositioning: ListView.OverlayHeader
|
||||||
z: 9997
|
header: Kirigami.ListSectionHeader {
|
||||||
type: Kirigami.MessageType.Information
|
z: 9997
|
||||||
id: oilMessage
|
contentItem: Layouts.ColumnLayout {
|
||||||
showCloseButton: false
|
Kirigami.InlineMessage {
|
||||||
Component.onCompleted: {
|
Layouts.Layout.fillWidth: true
|
||||||
//TODO: check if oil change is needed.
|
type: Kirigami.MessageType.Information
|
||||||
|
id: oilMessage
|
||||||
|
showCloseButton: false
|
||||||
|
Component.onCompleted: {
|
||||||
|
//TODO: check if oil change is needed.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
delegate: Kirigami.SwipeListItem {
|
||||||
ListView {
|
contentItem: Layouts.ColumnLayout {
|
||||||
id: serviceView
|
Kirigami.Heading {
|
||||||
model: recordModel
|
text: serviceprovider
|
||||||
delegate: Kirigami.SwipeListItem {
|
level: 2
|
||||||
contentItem: Layouts.ColumnLayout {
|
}
|
||||||
Kirigami.Heading {
|
Kirigami.Heading {
|
||||||
text: serviceprovider
|
text: servicetypename
|
||||||
level: 2
|
level: 2
|
||||||
}
|
}
|
||||||
Kirigami.Heading {
|
Controls.Label {
|
||||||
text: servicetypename
|
text: new Date(servicedate).toLocaleDateString(Qt.locale())
|
||||||
level: 2
|
}
|
||||||
|
Row {
|
||||||
|
Image {
|
||||||
|
source: "qrc:/speed.svg"
|
||||||
|
sourceSize.width: 16
|
||||||
|
sourceSize.height: 16
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: new Date(servicedate).toLocaleDateString(Qt.locale())
|
text: miles
|
||||||
}
|
|
||||||
Row {
|
|
||||||
Image {
|
|
||||||
source: "qrc:/speed.svg"
|
|
||||||
sourceSize.width: 16
|
|
||||||
sourceSize.height: 16
|
|
||||||
}
|
|
||||||
Controls.Label {
|
|
||||||
text: miles
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Controls.Label {
|
|
||||||
text: notes
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actions: [
|
Controls.Label {
|
||||||
Kirigami.Action {
|
text: notes
|
||||||
text: qsTr("Remove")
|
}
|
||||||
iconName: "edit-delete"
|
|
||||||
onTriggered: {
|
|
||||||
recordModel.removeRecord(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
actions: [
|
||||||
//}
|
Kirigami.Action {
|
||||||
|
text: qsTr("Remove")
|
||||||
|
iconName: "edit-delete"
|
||||||
|
onTriggered: {
|
||||||
|
recordModel.removeRecord(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user