Create a model based on another model so it tracks changes on the Rust side #5413
Replies: 2 comments
-
I havent looked into this at all, or created a custom model for Slint. I did see in the docs somewhere there is a model peer struxt (I think) that can be notified if another model changes. I imagine you would want that? Perhaps the source code for FilterModel would be a place to start looking? |
Beta Was this translation helpful? Give feedback.
-
I think the solution you suggest with the |
Beta Was this translation helpful? Give feedback.
-
Code from #3608 (comment) again, node graph struggles.
Here
links
reacts to the changes ofnodes
But when you do
Then it obviously doesn't react because it just copies the value.
So how do I make Rust code behave like it is in Slint?
The only idea I have right now is to make a custom implementation of the Model, like in the 7guis/cells example, but I don't know how.
I've looked at the generated code, it uses
row_data_tracked
but I don't know how to use it and if it is useful at all.Instead of this I can do
But am still interested the solution.
Another solution is to use workaround like #4717 and recreate every link.
Honestly it is kinda strange that it reacts to model changes at all in slint, but whatever.
Beta Was this translation helpful? Give feedback.
All reactions