I'm using:
- Qt 5.12
- IMX 587 processor built on my target device.
I am facing some performance issues because the repeater uses the JavaScript array model, then whenever any item have changes, the whole model is reset and the repeater redraws all items.
Same issue in: Repeater model very slow when copying an item
My same project code is flashed in updated Processor version IMX 8 target device and also updated Qt version 6.4. In this device, I couldn't see this performance issue.
So, If I update my Qt version from 5.12 to 6.4 in IMX 587 processor target device, does this performance issue get resolved?
Since then, I tried to change old code that is a big and complex one.
I also tried modifying my code to use List model:
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 exposing this ListModel in Repeater:

But our expected result is:

I thought item properties are not set properly in the delegate.
Where have I made a mistake in my code and how do I resolve it?
The following QML demonstrates 3 different ways to set and update the
modelin yourRepeaterThe first method,
dataModeluses straight Javascript, and, no change detection occurs, so, we have to repeatedly updaterepeater.modelto see the changes, hence the inefficiency.The second and third methods,
list<var>andListModelrespectively, both have change detection, so, theRepeatermodel can be set declarative and will react to subsequentpush/append.In short, don't expect upgrading to Qt6.4 will solve your problem. You will need to do code changes to switch away from your
Javascriptmodel.