Reputation: 12904
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.
AbstractTableModel
on C++ instead of AbstractListModel
view will loop through its columns and call markerDelegate
on each column. Or do the same with row.markerDelegate
Which one of these is standard practice ? or feasible ? How to achieve any one of these ?
Upvotes: 4
Views: 1047
Reputation: 69
You can store data for each model in container and load appropriate data to the model object
Upvotes: -2