diff options
author | jan Iversen <jan@casacondor.com> | 2020-01-29 11:14:50 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-29 06:19:25 -0800 |
commit | a534f1a25c36e4dbd27cc7d341d0c0d1a92d7cc7 (patch) | |
tree | f243379e6a00e956fc0664db725f1e6c9eb08082 | |
parent | eec15112180a22ffc04f15a20706e9c6941698d0 (diff) | |
download | subsurface-a534f1a25c36e4dbd27cc7d341d0c0d1a92d7cc7.tar.gz |
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>
-rw-r--r-- | mobile-widgets/qml/DiveSummary.qml | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/mobile-widgets/qml/DiveSummary.qml b/mobile-widgets/qml/DiveSummary.qml index fe554bc0c..b690109e4 100644 --- a/mobile-widgets/qml/DiveSummary.qml +++ b/mobile-widgets/qml/DiveSummary.qml @@ -11,23 +11,6 @@ Kirigami.ScrollablePage { background: Rectangle { color: subsurfaceTheme.backgroundColor } title: qsTr("Dive summary") - ListModel { - id: monthModel - ListElement {text: qsTr("Total")} - ListElement {text: qsTr(" 1 month [ 30 days]")} - ListElement {text: qsTr(" 2 month [ 60 days]")} - ListElement {text: qsTr(" 3 month [ 90 days]")} - ListElement {text: qsTr(" 4 month [120 days]")} - ListElement {text: qsTr(" 5 month [150 days]")} - ListElement {text: qsTr(" 6 month [180 days]")} - ListElement {text: qsTr(" 7 month [210 days]")} - ListElement {text: qsTr(" 8 month [240 days]")} - ListElement {text: qsTr(" 9 month [270 days]")} - ListElement {text: qsTr("10 month [300 days]")} - ListElement {text: qsTr("11 month [330 days]")} - ListElement {text: qsTr("12 month [360 days]")} - } - onVisibleChanged: { if (visible) Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex) @@ -39,6 +22,23 @@ Kirigami.ScrollablePage { columnSpacing: Kirigami.Units.smallSpacing rowSpacing: Kirigami.Units.smallSpacing + ListModel { + id: monthModel + ListElement {text: qsTr("Total")} + ListElement {text: qsTr(" 1 month [ 30 days]")} + ListElement {text: qsTr(" 2 month [ 60 days]")} + ListElement {text: qsTr(" 3 month [ 90 days]")} + ListElement {text: qsTr(" 4 month [120 days]")} + ListElement {text: qsTr(" 5 month [150 days]")} + ListElement {text: qsTr(" 6 month [180 days]")} + ListElement {text: qsTr(" 7 month [210 days]")} + ListElement {text: qsTr(" 8 month [240 days]")} + ListElement {text: qsTr(" 9 month [270 days]")} + ListElement {text: qsTr("10 month [300 days]")} + ListElement {text: qsTr("11 month [330 days]")} + ListElement {text: qsTr("12 month [360 days]")} + } + TemplateLabel { text: qsTr("oldest/newest dive") font.bold: true |