Skip to content

Iterate in a StandartTableView rows declaration #4643

Answered by ogoffart
guillaumeAbel asked this question in Q&A
Discussion options

You must be logged in to vote

You have to do fill your model from the native code.
For example, in rust:

let row_data: Rc<VecModel<slint::ModelRc<StandardListViewItem>>> = Rc::new(VecModel::default());
for r in 1..101 {
let items = Rc::new(VecModel::default());
for c in 1..5 {
items.push(slint::format!("Item {r}.{c}").into());
}
row_data.push(items.into());
}
app.global::<TableViewPageAdapter>().set_row_data(row_data.clone().into());

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@guillaumeAbel
Comment options

@chlghdwns
Comment options

Answer selected by guillaumeAbel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants