Can I make a QML Item contained into a ListView object unselectable? Something like this
for(var i=0; i < ListView.model.count; i++) {
ListView.model.get(i).selectable = false;
}
If by “unselectable” you mean to prevent the user from being able to click on the item then you can add a
selectableproperty to the model as you have done, then use it in theonClickedevent in yourListViewdelegate – something like this:Also, it looks like you are referencing the model incorrectly. Either use the id of the
ListView(e.g.myListView.model) or if your for loop is within scope you can refer to themodeldirectly.