From 2460a29a09116ebdf6d6eb7a7cc9bf5c4e93f7ee Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 14 Nov 2022 15:02:38 +0100 Subject: Revive mapitems_backends manual test Fix up the imports so that the qml file loads. Then follow the changes for the available polyline backends. Change-Id: I01a229264275ef0b89eb71332b06da0be0097b08 Reviewed-by: Volker Hilsheimer --- tests/manual/mapitems_backends/main.qml | 38 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/manual/mapitems_backends/main.qml b/tests/manual/mapitems_backends/main.qml index d04f5474..56c4fda2 100644 --- a/tests/manual/mapitems_backends/main.qml +++ b/tests/manual/mapitems_backends/main.qml @@ -26,11 +26,10 @@ ** ****************************************************************************/ -import QtQuick 2.7 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.2 as C2 -import QtPositioning 5.6 -import QtLocation 5.15 +import QtQuick +import QtQuick.Controls as C2 +import QtPositioning +import QtLocation Window { id: win @@ -118,7 +117,7 @@ Window { Component.onCompleted: { var o = migComponent.createObject(map) o.glPolygons = Qt.binding(function() {return switchPolygons1.checked}) - o.glPolylines = Qt.binding(function() {return switchPolylines1.currentText}) + o.glPolylines = Qt.binding(function() {return switchPolylines1.checked}) o.glCircles = Qt.binding(function() {return switchCircles1.checked}) o.glRectangles = Qt.binding(function() {return switchRectangles1.checked}) map.addMapItemGroup(o); @@ -135,7 +134,6 @@ Window { C2.Switch { text: qsTr("OGL Polygons") id: switchPolygons1 - checked: true anchors { top: parent.top right: parent.right @@ -143,8 +141,8 @@ Window { rightMargin: 12 } } - C2.ComboBox { - model: ['Software','OpenGL','Triangulated'] + C2.Switch { + text: qsTr("OGL Polylines") id: switchPolylines1 anchors { top: switchPolygons1.bottom @@ -228,7 +226,7 @@ Window { Component.onCompleted: { var o = migComponent.createObject(map2) o.glPolygons = Qt.binding(function() {return switchPolygons2.checked}) - o.glPolylines = Qt.binding(function() {return switchPolylines2.currentText}) + o.glPolylines = Qt.binding(function() {return switchPolylines2.checked}) o.glCircles = Qt.binding(function() {return switchCircles2.checked}) o.glRectangles = Qt.binding(function() {return switchRectangles2.checked}) map2.addMapItemGroup(o); @@ -237,7 +235,6 @@ Window { C2.Switch { text: qsTr("OGL Polygons") id: switchPolygons2 - checked: false anchors { top: parent.top right: parent.right @@ -245,8 +242,8 @@ Window { rightMargin: 12 } } - C2.ComboBox { - model: ['Software','OpenGL','Triangulated'] + C2.Switch { + text: qsTr("OGL Polylines") id: switchPolylines2 anchors { top: switchPolygons2.bottom @@ -254,7 +251,6 @@ Window { topMargin: 12 rightMargin: 12 } - onCurrentTextChanged: console.log("CURRENT TEXT CHANGED ",currentText) } C2.Switch { text: qsTr("OGL Circles") @@ -288,17 +284,15 @@ Window { id: migComponent MapItemGroup { id: polyGroup - property bool glPolygons : true - property string glPolylines : "Software" - property bool glCircles : true - property bool glRectangles : true + property bool glPolygons + property bool glPolylines + property bool glCircles + property bool glRectangles objectName: parent.objectName + "_MIG_" function polylineBackend() { - return (polyGroup.glPolylines === "OpenGL") - ? MapPolyline.OpenGLLineStrip - : ((polyGroup.glPolylines === "Software") - ? MapPolyline.Software : MapPolyline.OpenGLExtruded) + return (polyGroup.glPolylines) + ? MapPolyline.OpenGL : MapPolyline.Software } function polygonBackend() -- cgit v1.2.1