mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
C++ tutorial: fix "Rust"->"C++" typos
We are in the C++ tutorial so it's only C++ code
This commit is contained in:
parent
b620986e35
commit
1b0217fe98
2 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
# Creating The Tiles From C++
|
||||
|
||||
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,
|
||||
We'll do so by accessing the `memory_tiles` property through the C++ 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://slint-ui.com/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
|
||||
|
|
|
@ -4,8 +4,8 @@ After modeling a single tile, let's create a grid of them. For the grid to be ou
|
|||
|
||||
1. A data model: This shall be an array where each element describes the tile data structure, such as the
|
||||
url of the image, whether the image shall be visible and if this tile has been solved. We modify the model
|
||||
from Rust code.
|
||||
1. A way of creating many instances of the tiles, with the above `.slint` markup code.
|
||||
from C++ code.
|
||||
2. A way of creating many instances of the tiles, with the above `.slint` markup code.
|
||||
|
||||
In Slint we can declare an array of structures using brackets, to create a model. We can use the <span class="hljs-keyword">for</span> loop
|
||||
to create many instances of the same element. In `.slint` the for loop is declarative and automatically updates when
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue