While this is a lot more complicated than necessary, your problem with the "unresponsive" child is that a binding is overwritten.
Basically your initial delegate state is this
CheckBox {
checked: model.selected
}
CheckBox {
checked: model.selected
}
To copy to clipboard, switch view to plain text mode
which makes the CheckBox follow the model.
Then you click the checkbox, you end up with
CheckBox {
checked: true // or false depending on the previous value
}
CheckBox {
checked: true // or false depending on the previous value
}
To copy to clipboard, switch view to plain text mode
So there is no binding to the model anymore.
You need to restore the binding after the component has changed its value by itself
CheckBox {
checked: model.selected
onCheckedChanged: {
// not sure of ListModel allows to modify items directly, this seems to already work in your code
checkBoxModel.set(model.index, { "selected": checked });
// restore binding
checked = Qt.binding(function() { return model.selected; });
}
}
CheckBox {
checked: model.selected
onCheckedChanged: {
// not sure of ListModel allows to modify items directly, this seems to already work in your code
checkBoxModel.set(model.index, { "selected": checked });
// restore binding
checked = Qt.binding(function() { return model.selected; });
}
}
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks