mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 07:37:24 +00:00
docs: Rework the rust part of the documentation (#2240)
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
This commit is contained in:
parent
daab51543f
commit
96f75bdd0c
3 changed files with 71 additions and 47 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue