Open god-anubis opened 1 year ago
Thank you for your detailed and informative report.
You're encountering three separate issues related to binding:
and binding to a particular element of a model using the []
syntax.
We are aware of these issues and would like to see them supported in the future. However, at this time they are not yet implemented.
We have ongoing discussions about the struct binding issue in #814
For the two other issue we could use a similar approach to the struct binding issue and call model.set_row_data
behind the scenes when the property is changed. However, implementing any of these issues is not a trivial task.
I am rewording the title of this issue to keep track of the binding to model issue, while the binding to struct is tracked in #814
Maybe this is fixed in the updated syntax, but with the current version of 0.3.3 (using rust) issues exist in how/where properties are declared that determine if two-way bindings are possible in .slint files.
Regular properties work with two-way bindings as expected:
But if a struct is used things break:
There is a workaround for the struct problem using inheritance though (not sure if slint is intended to be used like this):
Also the use of arrays (at least in for loops) may break things:
Would the above examples be expected to work? Feel free to point out any incorrect assumptions on my part or any part of the documentation that mentions or explains the observed behaviour that I might have missed.