maplocationmodel: store the coordinate as QGeoCoordinate

Instead of maintaining a seperate latitude/longitude values
in C++ and passing them to QML separatelly, pass them as a QGeoCoordinate.

This reduces the number of model "roles" and also prevents the creations
of extra objects in QML (e.g. via QtPositioning.coordinate(..)).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-17 22:36:55 +03:00 committed by Dirk Hohndel
parent d783984443
commit f44645b6fe
3 changed files with 11 additions and 16 deletions

View file

@ -37,7 +37,7 @@ Item {
delegate: MapQuickItem {
anchorPoint.x: 0
anchorPoint.y: mapItemImage.height
coordinate: QtPositioning.coordinate(latitude, longitude)
coordinate: model.coordinate
sourceItem: Image { id: mapItemImage; source: "qrc:///mapwidget-marker-image" }
}
}