diff --git a/qml/pages/DetailPage.qml b/qml/pages/DetailPage.qml index ae4c482..7d611e6 100644 --- a/qml/pages/DetailPage.qml +++ b/qml/pages/DetailPage.qml @@ -207,7 +207,6 @@ Page { anchors.margins: Theme.paddingSmall color: Theme.highlightColor font.pixelSize: Theme.fontSizeSmall - background: Rectangle { color: Theme.rgba(Theme.primaryColor, 0.1); radius: Theme.paddingSmall } } Timer { id: tipTimer; interval: 2500; onTriggered: tip.visible = false } } diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index c9c59a2..d6b0084 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -112,7 +112,11 @@ Page { } onClicked: { console.log("[tide] open port:", model.name, "custom:", model.custom) - page.openDetail(model.port, model.realIndex, model.custom) + // model.port (array JS) non è esposto dai ListModel su Qt 5.6: + // si ricostruisce il porto dalle strutture JS tramite l'indice. + var p = model.custom ? page.customPorts[model.customIndex] + : Tides.PORTS[model.realIndex] + page.openDetail(p, model.realIndex, model.custom) } } @@ -131,7 +135,7 @@ Page { portModel.append({ name: p[0], country: p[1], range: "±" + (p[4][1][0] + p[4][2][0]).toFixed(2) + " m", - port: p, realIndex: i, custom: false, + realIndex: i, customIndex: -1, custom: false, isPreferred: (pref === p[0]) }) } @@ -142,7 +146,7 @@ Page { portModel.append({ name: p[0], country: qsTr("searched city"), range: "±" + (p[4][1][0] + p[4][2][0]).toFixed(2) + " m", - port: p, realIndex: -1, custom: true, + realIndex: -1, customIndex: i, custom: true, isPreferred: (pref === p[0]) }) }