slint
slint copied to clipboard
Using non standard types in listview struct/model?
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
}
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.