I want to populate a Qml Map with map elements (like MapCircle, ...) from a QAbstractListModel
. There seem to be two Qml tools suitable for this, MapItemView
[1] and Repeater
[2]. The Repeater
is more powerful (e.g. it allows nested models) - so is there any reason to use the MapItemView
instead of a Repeater
?
Regards,
[1] http://doc.qt.io/qt-5/qml-qtlocation-mapitemview.html
[2] http://doc.qt.io/qt-5/qml-qtquick-repeater.html
MapItemView source: http://code.qt.io/cgit/qt/qtlocation.git/tree/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
Repeater source: http://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/items/qquickrepeater.cpp
Views
only instantiate as much as needed. So what is outside theviewport
won't clutter your memory and initial creation time will be better. TheRepeater
is dump. It will createItems
s for every element in the model, no matter whether they will be shown or not. – derMMapItemView
adds all items to the Map. I am not sure whatRepeater
exactly does but probably it will also add the items just to the map. The map itself handles the visible item rendering. – Hyndrix