slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 568 forks source link

Add a reverse model #3120

Closed Guiguiprim closed 1 year ago

Guiguiprim commented 1 year ago

Add a reverse model that would allow for O(1) reversing of a given input model.

Step:

Also would be nice to support this in slint such as for data in reversed(root.model): Item { /.../ } operation on models is tracked at https://github.com/slint-ui/slint/issues/1328 although reversed doesn't need a lambda

FloVanGH commented 1 year ago

Would be also nice to have a C++ variant of the ReverseModel 😉.

Guiguiprim commented 1 year ago

Would be also nice to have a C++ variant of the ReverseModel wink.

Indeed. But I haven't done C++ for a while (since I stopped using Qt), I'm not setup for it anymore and I don't want to, so I will cowardly let someone else do it :stuck_out_tongue_closed_eyes:

FloVanGH commented 1 year ago

I can handle it ;-)

FloVanGH commented 1 year ago

Cpp ReverseModel is not also merged.