docs: Rework the rust part of the documentation (#2240)

Co-authored-by: Simon Hausmann <hausmann@gmail.com>
This commit is contained in:
Tobias Hunger 2023-02-20 21:06:05 +01:00 committed by GitHub
parent daab51543f
commit 96f75bdd0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 47 deletions

View file

@ -32,7 +32,7 @@ actual instance and keeps it alive as long as at least one
{cpp:class}`slint::ComponentHandle` is in scope, similar to `std::shared_ptr<T>`.
For more complex user interfaces it's common to supply data in the form of an
abstract data model, that is used with [`for` - `in`](../slint/repetition.html)
abstract data model, that's used with [`for` - `in`](../slint/repetition.html)
repetitions or [`ListView`](../slint/widgets.md#listview) elements in the
`.slint` language. All models in C++ are sub-classes of the
{cpp:class}`slint::Model` and you can sub-class it yourself. For convenience,
@ -44,9 +44,9 @@ by a `std::vector<T>`.
Let's assume we've this code in our `.slint` file:
```slint,no-preview
SampleComponent := Window {
property<int> counter;
property<string> user_name;
component SampleComponent inherits Window {
in-out property<int> counter;
in-out property<string> user_name;
callback hello;
// ... maybe more elements here
}