mobile-widgets/qml: Fix Kirigami error.

Solve kirigami error:
INFO: qrc:/org/kde/kirigami/ScrollablePage.qml:187: TypeError: Cannot assign to read-only property "parent".

Kirigami.scrollPage does not allow a ListModel be defined, even though it is allowed in QtQuick.

Signed-off-by: jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2020-01-29 11:14:50 +01:00 committed by Dirk Hohndel
parent eec1511218
commit a534f1a25c

View file

@ -11,6 +11,17 @@ Kirigami.ScrollablePage {
background: Rectangle { color: subsurfaceTheme.backgroundColor }
title: qsTr("Dive summary")
onVisibleChanged: {
if (visible)
Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
}
GridLayout {
columns: 3
width: parent.width
columnSpacing: Kirigami.Units.smallSpacing
rowSpacing: Kirigami.Units.smallSpacing
ListModel {
id: monthModel
ListElement {text: qsTr("Total")}
@ -28,17 +39,6 @@ Kirigami.ScrollablePage {
ListElement {text: qsTr("12 month [360 days]")}
}
onVisibleChanged: {
if (visible)
Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
}
GridLayout {
columns: 3
width: parent.width
columnSpacing: Kirigami.Units.smallSpacing
rowSpacing: Kirigami.Units.smallSpacing
TemplateLabel {
text: qsTr("oldest/newest dive")
font.bold: true