You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project, where I have some data in a bit more complex data structure consisting of a hashmap and possibly nested hash maps. Sort of like a very shallow tree structure.
Now, I want to display that data in the UI. Currently, I have a function that flattens the data structure to an array, which is then used by the UI to display the data in a custom table-like view.
Interactive elements in the view are stored separately as changing the vector model does not update the original structure of course.
I looked at implementing the Model trait for the data structure, but as the models in slint work with indicies, I think I would need some overhead to be able to notify when e.g. single rows change.
Is there a better solution for this?
EDIT: I've also though about having a callback to access items in the hash map and then just iterating over the amount of items in slint, but I think the problem there is, that changing the contents of the data structure will not necessarily update the UI.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a project, where I have some data in a bit more complex data structure consisting of a hashmap and possibly nested hash maps. Sort of like a very shallow tree structure.
Now, I want to display that data in the UI. Currently, I have a function that flattens the data structure to an array, which is then used by the UI to display the data in a custom table-like view.
Interactive elements in the view are stored separately as changing the vector model does not update the original structure of course.
I looked at implementing the Model trait for the data structure, but as the models in slint work with indicies, I think I would need some overhead to be able to notify when e.g. single rows change.
Is there a better solution for this?
EDIT: I've also though about having a callback to access items in the hash map and then just iterating over the amount of items in slint, but I think the problem there is, that changing the contents of the data structure will not necessarily update the UI.
Beta Was this translation helpful? Give feedback.
All reactions