Property Changed Callback in Slint #5864
Replies: 2 comments 8 replies
-
If property-changed-callbacks are added, that looks to me like an unfinished signals-like system. Why not go the full route and add proper derived values and effects. |
Beta Was this translation helpful? Give feedback.
-
From my experience with property changed callbacks in Qt: They can be super useful but also are terrible for one of their main tasks — and this shows up surprisingly often and was never truly addressed by Qt: two-way synchronization with the backend (aka app-core, in C++ for example, not server). This just doesn't work well with property changed callbacks because they are one-way in nature. So you end up either separating the callbacks by source ( So if I would have to design such a system from scratch I would definitely separate values/state and events. This effectively gives you three property changed callbacks (state changes, value changed by component (=input), value changed from the "outside"). Have you also considered to go for a reactive system like rxRust for example? This is way more flexible and powerful than callbacks (and also easier in the long run imho). |
Beta Was this translation helpful? Give feedback.
-
Discussion for the blog post: https://slint.dev/blog/property-changed-callback
Beta Was this translation helpful? Give feedback.
All reactions