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>
- add() will be used to add a MapLocation to the model with
beginInsertRows()...endInsertRows()
- clear() will be used to clear the model with beginRemoveRows()...
endRemoveRows()
NOTE: emiting dataChanged() does not seem to update the QML view for
this model so calling being<..>Rows() seems to be the "correct Qt
approach" to do this.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The QML Map widget requires a QAbstractListModel based model to operate
with good performance. Technically gpslistmodel.cpp can be used for that
same purpose (e.g. has GPS coordinates), but the way it updates
may complicate the Map widget integration.
Thus, a new model is created - MapLocationModel, with items of type
MapLocation, for an attempt for a clean project structure on the C++ side.
For now it only handles latitude and longitude.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>