You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my appwindow.slint file I have a list view that I want to populate from my rust code. I'm doing a bluetooth scanner, so want to keep a list of peripheral devices in the listview item.
How do I go about setting that up in the slint file?
What I have
@rust-attr(derive(serde::Serialize, serde::Deserialize))
export struct ScanItem {
title: string,
checked: bool,
peripheral: btleplug::api::Peripheral, // <-- this doent work
}
The text was updated successfully, but these errors were encountered:
Slint struct and other types can currently only contains fields of type known to Slint.
I don't know if we can support this usecase.
It can be worked around by using an integer id, and have mapping between id and the actual type in Rust.
Slint struct and other types can currently only contains fields of type known to Slint. I don't know if we can support this usecase. It can be worked around by using an integer id, and have mapping between id and the actual type in Rust.
True, it's possible to do this with an id; but if you want to do anything more complicated inside the for loop, like calling a common function that affects each child individually, I think you would need the ability to pass more complicated types of variables as parameters in the function, like Widget types. This would be a huge bonus. This is one huge advantage of Flutter. It is similar to issue #4891.
It would be interesting to know how difficult this would be. I think this is a bottle-neck for a lot of functionality.
We would need to support importing rust struct.
I think this would be a duplicate of #1726
So it would allow to import Rust struct from Slint code
Closing this issue as duplicate of #1726
In my appwindow.slint file I have a list view that I want to populate from my rust code. I'm doing a bluetooth scanner, so want to keep a list of peripheral devices in the listview item.
How do I go about setting that up in the slint file?
What I have
The text was updated successfully, but these errors were encountered: