Setting the rows of a StandardTableView from the outside #9657
-
|
In Python I have a list of dicts that look like this: I hope to wrap this into a model that can be understood by StandardTable view, but I have no success in doing so. For example a similar structure in Slint can't be turned into rows like this, failing in a parse error, seemingly because it emits an array and not a named struct: An earlier way of setting the rows via List model along the lines of: with In all honesty, the status should be an icon as well, not a text, but for now I think I could substitute for Unicode text. In the end, I hope that this relatively universal procedure can be documented somewhere. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I have made progress in this problem. For a list of dicts as mentioned, you have to wrap every list in a slint.ListModel, like this: Then we can mutate |
Beta Was this translation helpful? Give feedback.
-
|
I think this is all for now. I have other problems but that will use another topic. |
Beta Was this translation helpful? Give feedback.
I have made progress in this problem.
For a list of dicts as mentioned, you have to wrap every list in a slint.ListModel, like this:
Then we can mutate
self._gamesusing the usual methods (likeself._games[1].set_row_data(0, {"text": "✓"})) and then it will show up in the GUI as well.