I have a model on C++ side which is based on AbstractListModel
. The model have a set of locations through a role that is being shown in a MapView
. Following is the minimal version of my code. markerModel: MarkerModel
is defined on C++ side.
Map{
MapItemView {
model: markerModel
delegate: markerDelegate
}
Component {
id: markerDelegate
MapQuickItem{
anchorPoint: Qt.point(2.5, 2.5)
coordinate: QtPositioning.coordinate(position.y, position.x)
zoomLevel: 0
sourceItem: Rectangle{
...
}
}
}
}
The delegate actually draws points for each positions in the model. Now I want to have multiple such models.
- I can have an
AbstractTableModel
on C++ instead ofAbstractListModel
view will loop through its columns and callmarkerDelegate
on each column. Or do the same with row. - Have multiple models dynamically exposed to QML rendered on a single view with a single delegate
markerDelegate
Which one of these is standard practice ? or feasible ? How to achieve any one of these ?