Closed rdrpenguin04 closed 2 years ago
I'll create a fork of the repo and try to implement this; the main thing I've been told could be problematic is notifying the model that the entire thing has been overwritten. A temporary option could be to implement the replace function in terms of remove
ing every existing entry and then push
ing every new entry.
In my application, fairly often, I don't just need to remove an item from a list and add another one; I need to replace the list with an entirely separate list. I could use
set_<model name>
instead, but then I also have to reset every other function that had theModelRc
cloned... needless to say, this is complicated, and it seems like there should be a better way.It seems like it wouldn't be too hard to have a function to replace the
Vec
in aVecModel
with an entirely newVec
; is there anything that would be blocking this? If not, I could implement it probably.Edit: It would also be useful to read the innerSolved withVec
for other purposes, like finding an element with a certain ID.Model::iter()
Originally posted by @rdrpenguin04 in https://github.com/slint-ui/slint/discussions/1043