From this link described the Repeater problem.
@Stephen Quan, As per your suggestion modified code to ListModel.
ListModel {
id:listModel
}
function handleModelChanged() {
delegateModel.model = areaViewModel;
const newUiType = areaViewModel.uiType;
if (newUiType !== uiType || !modelDataIsEqual(delegateModel, listModel) ) {
listModel.clear();
dlaButtonStyle = areaModel.combineBtnStyle;
oddEvenBtnAppearance = areaModel.getLockedButtonAppearance();
for (var row = 0; row < delegateModel.model.rowCount(); row++) {
var item = delegateModel.items.get(row).model;
var button = dataModelItemToButton(item);
listModel.append(button);
}
console.log(listModel.get(0).dataAreaName);
uiType = newUiType;
} else {
console.log("GRID buttons are same")
}
}
Repeater {
id: areaRepeater
model: listModel
delegate: {
gridButton;
}
onItemAdded: {
if (index == areaRepeater.count - 1) {
console.log("GRID repeater added " + areaRepeater.count + " buttons")
updateItems()
}
}
}
But, I got this output when expose this listmodel in repeater:
But our expected result is:

I thought item properties not set properly in delegate. Where I made mistake in my code. Kindly, help to resolve it.
Thanks Advance
When switching from
Javascript modeltoListModelbe aware that your delegate bindings changes frommodelData.propertytomodel.propertyor evenproperty.The other concern I have with your code is it appears that you're trying to dynamically create QML components using QML code. You should declare your delegates declarative and let Qt take care of the delegate construction and destructor for you.
The following demonstrates a simpler approach to populating
GridViewListModel. Note that you do not need to constantly reassign theGridView.model, we set it once, and, after that, we just append directly to theListModel.In the following we are 'slowly' populating the
ListModelwith 100000 records. You should observe that there is no exponential slowdown. The latter records are being inserted at a similar speed as the first records were. Also note that the populating of theListModelautomatically creates new delegates. Likewise, changes or deletions to theListModelwill also automatically update the delegates.You can Try it Online!