Change QJSValue properties to QList<QGeoCoordinate/Rectangle>
The QML engine is able to operate on lists of gadgets, there is no need
for using private APIs to operate on QJSValue.
For the time being, this breaks a QML construct like
path[0].longitude = 0
This no longer changes the value of path[0].latitude in place. Instead,
use
var path0 = path[0]
path0.longitude = ...
path[0] = path0
This is consistent with other properties that have type list<gadget>, as
QML operates on copies of values, not on references. Adapt the test case
accordingly.
Since support for value-initializing properties of type list<gadget>
requires plumbing in the QML engine, and registration of conversion
routines from QVariantMap to QGeoCoordinate, augment the test.
Remove the now unnecessary toList/fromList conversion functions, and
the dependency to private QtQml libraries.
Fixes: QTBUG-105241
Change-Id: I8f248c457a6de27a3b2680bdc948c5683ebc7fa0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
| commit | a6c48812eff4e1aa9b05ea4b811de357242c5588 |
| parent | 366a6379fb80e8c223ae57b2fd791ffdfeacdbf3 |
| author | Volker Hilsheimer <volker.hilsheimer@qt.io> |
| committer | Volker Hilsheimer <volker.hilsheimer@qt.io> |
| commit time | Thu, 15 Sep 2022 14:40:23 +0200 |
- M src/location/CMakeLists.txt
- M src/location/declarativemaps/locationvaluetypehelper.cpp
- M src/location/declarativemaps/locationvaluetypehelper_p.h
- M src/location/declarativemaps/qdeclarativegeoroute.cpp
- M src/location/declarativemaps/qdeclarativegeoroute_p.h
- M src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
- M src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
- M src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
- M src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
- M src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
- M src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
- M src/location/declarativemaps/qdeclarativeroutemapitem.cpp
- M src/location/declarativemaps/qdeclarativeroutemapitem_p.h
- M tests/auto/declarative_location_core/tst_routing.qml
- M tests/auto/declarative_ui/tst_map_item_details.qml