mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 23:27:22 +00:00
Rename sixtyfps_
This commit is contained in:
parent
6c210b549b
commit
d2d6a5cc6a
20 changed files with 65 additions and 65 deletions
|
@ -3,9 +3,9 @@
|
|||
What we'll do is take the list of tiles declared in the .slint language, duplicate it, and shuffle it.
|
||||
We'll do so by accessing the `memory_tiles` property through the Rust code. For each top-level property,
|
||||
a getter and a setter function is generated - in our case `get_memory_tiles` and `set_memory_tiles`.
|
||||
Since `memory_tiles` is an array in the `.slint` language, it is represented as a [`std::shared_ptr<slint::Model>`](https://sixtyfps.io/docs/cpp/api/classsixtyfps_1_1model).
|
||||
Since `memory_tiles` is an array in the `.slint` language, it is represented as a [`std::shared_ptr<slint::Model>`](https://sixtyfps.io/docs/cpp/api/classslint_1_1model).
|
||||
We can't modify the model generated by the .slint, but we can extract the tiles from it, and put it
|
||||
in a [`slint::VectorModel`](https://sixtyfps.io/docs/cpp/api/classsixtyfps_1_1vectormodel) which inherits from `Model`.
|
||||
in a [`slint::VectorModel`](https://sixtyfps.io/docs/cpp/api/classslint_1_1vectormodel) which inherits from `Model`.
|
||||
`VectorModel` allows us to make modifications and we can use it to replace the static generated model.
|
||||
|
||||
We modify the main function like so:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue