Commit graph

30 commits

Author SHA1 Message Date
Olivier Goffart
9eb52fb14a Demos: fix duplicate artifact name in Windows
```
warning: output filename collision.
The bin target `printerdemo` in package `printerdemo v1.5.0 (C:\dev\slint\examples\printerdemo\rust)` has the same output filename as the lib target `printerdemo` in package `printerdemo v1.5.0 (C:\dev\slint\examples\printerdemo\rust)`.
Colliding filename is: C:\dev\slint\target\debug\deps\printerdemo.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
```
2024-03-06 11:16:07 +01:00
Olivier Goffart
b236d2d06e Examples: make both a lib and a bin by default
Note that the trick to use the same file for both was not ideal because
it produces a warning and would compile it twice if it was by default.
So just make both a lib.rs and a main.rs
2024-02-22 09:02:06 +01:00
Olivier Goffart
ddebd64064
Android: make slint::android public
Add a `backend-android-activity-05` feature that enables the
`slint::android` module
2024-02-20 15:00:11 +01:00
Olivier Goffart
f495235b74 Android todo example: cleanup console output and remove warning 2024-01-05 16:11:28 +01:00
Olivier Goffart
a3e3cccf0c Todo Android example: state saving/restore 2024-01-03 14:26:48 +01:00
Olivier Goffart
d63ff9c4c6 WIP: introduce an android-activity backend 2023-10-31 16:22:11 +01:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Aurindam Jana
e4338300de
Change license for examples to MIT (#2887) 2023-06-15 11:23:17 +02:00
Simon Hausmann
8ffb5131c7
Introduce error handling in the FemtoVG and Skia renderers (#2402)
Avoid unwrap() and expect() and instead propagate errors all the way
down to run_event_loop(), show(), and hide() in the Slint AIP.
2023-03-24 14:18:11 +01:00
Olivier Goffart
6889dfa5f5 Rust: Make new(), run() and show() report errors from the backend
Fixes #2198
2023-02-10 05:00:03 +01:00
Florian Blasius
129ee0acae
Florian/sort todo (#1721)
Implement `set_row_data` for `SortModel` and `FilterModel` (rust and cpp). Add sort and filter example to the todo example.
2022-10-11 18:58:00 +02:00
Lukas Jung
2d678078d3 Add close-callback to rust todo example 2022-03-17 08:51:00 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Tobias Hunger
cc3994b58d
Rename rust API 2022-02-02 13:26:35 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Olivier Goffart
929166f06c Change what is accepted by ModelRc::new and ModelRc::from
- ModelRc::new constructs a ModelRc from a impl Model
 - ModelRc::form constructs a ModelRc from a `Rc<dyn Model>` or `Rc<impl Model>`
2022-01-31 14:44:35 +01:00
Tobias Hunger
018c1a6666 Rename ModelHandle to SharedModel
This patch is mostly a rename now, but also contains a few small
cleanups.

SharedModel implements the Model trait itself and gracefully falls back
to an empty model is no Model was provided. This allows for some small
simplifications.

Also make sure to use the same comparision for SharedModels everywhere.
This fixes the last remaining clippy errors we had.
2022-01-30 01:26:35 +01:00
Tobias Hunger
e3c4209b1f
Change Model::row_data to return an Option<T> (#873)
Change Model::row_data to return an Option<T> (rust) or std::optional<T> (c++)

Co-authored-by: Olivier Goffart <olivier@woboq.com>
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2022-01-26 13:55:38 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Simon Hausmann
7047856d4e Replace FooRc with Foo and without ComponentHandle in examples and tests 2020-12-03 08:13:24 +01:00
Simon Hausmann
08b8a8cb83 Port the examples away from the ComponentHandle based API 2020-12-03 08:13:15 +01:00
Olivier Goffart
2ece3817cc Make ModelHandle a struct
Last commit broke for structures containing models, because models are not PartialEq.
So we need to implement PartialEq for ModelHandle. Which means a struct needs to
be created
2020-10-31 13:32:19 +01:00
Simon Hausmann
aad9306d54 Added a node version of the todo app 2020-10-21 13:49:18 +02:00
Olivier Goffart
4cf61b5617 Make the "remove done items" button work in the Todo rust example 2020-09-30 17:57:19 +02:00
Olivier Goffart
8361ef4019 Start code egeneration for the two ways binding
This is only meant to include the cases in which the property are optimized.
Does not work yet for the dynamic component
2020-09-24 14:37:16 +02:00
Olivier Goffart
221bb853d7 Change the exaple to used named struct for models 2020-09-17 14:00:50 +02:00
Olivier Goffart
913d680333 Recactor rust Model after first round of API review
- Remove EmptyModel and use an Option
 - Make ModelRc a type alias
 - Rename ArrayModel into VecModel
2020-09-16 14:25:57 +02:00
Olivier Goffart
0d8a38577d Todo example: make the "add todo" button do something 2020-09-14 16:38:45 +02:00
Olivier Goffart
e9b63552a7 Skeleton for a TODO app 2020-09-07 14:15:27 +02:00