1
0
Fork 0
mirror of synced 2024-05-21 12:52:37 +12:00
This commit is contained in:
Rafał Mikrut 2023-12-03 11:09:56 +01:00
parent 0bee05f2a0
commit b2891758a9

View file

@ -87,48 +87,48 @@ fn main() {
// app.set_similar_images_model(to_remove_create_with_header().into());
// }
fn to_remove_create_with_header() -> Rc<VecModel<MainListModel>> {
let header_row_data: Rc<VecModel<MainListModel>> = Rc::new(VecModel::default());
for r in 0..10_000 {
let items = VecModel::default();
for c in 0..3 {
items.push(slint::format!("Item {r}.{c}"));
}
let is_header = r % 3 == 0;
let is_checked = (r % 2 == 0) && !is_header;
let item = MainListModel {
checked: is_checked,
header_row: is_header,
selected_row: false,
val: ModelRc::new(items),
};
header_row_data.push(item);
}
header_row_data
}
fn to_remove_create_without_header(s: &str) -> Rc<VecModel<MainListModel>> {
let non_header_row_data: Rc<VecModel<MainListModel>> = Rc::new(VecModel::default());
for r in 0..100_000 {
let items = VecModel::default();
for c in 0..3 {
items.push(slint::format!("Item {r}.{c}.{s}"));
}
let is_checked = r % 2 == 0;
let item = MainListModel {
checked: is_checked,
header_row: false,
selected_row: false,
val: ModelRc::new(items),
};
non_header_row_data.push(item);
}
non_header_row_data
}
// fn to_remove_create_with_header() -> Rc<VecModel<MainListModel>> {
// let header_row_data: Rc<VecModel<MainListModel>> = Rc::new(VecModel::default());
// for r in 0..10_000 {
// let items = VecModel::default();
//
// for c in 0..3 {
// items.push(slint::format!("Item {r}.{c}"));
// }
//
// let is_header = r % 3 == 0;
// let is_checked = (r % 2 == 0) && !is_header;
//
// let item = MainListModel {
// checked: is_checked,
// header_row: is_header,
// selected_row: false,
// val: ModelRc::new(items),
// };
//
// header_row_data.push(item);
// }
// header_row_data
// }
// fn to_remove_create_without_header(s: &str) -> Rc<VecModel<MainListModel>> {
// let non_header_row_data: Rc<VecModel<MainListModel>> = Rc::new(VecModel::default());
// for r in 0..100_000 {
// let items = VecModel::default();
//
// for c in 0..3 {
// items.push(slint::format!("Item {r}.{c}.{s}"));
// }
//
// let is_checked = r % 2 == 0;
//
// let item = MainListModel {
// checked: is_checked,
// header_row: false,
// selected_row: false,
// val: ModelRc::new(items),
// };
//
// non_header_row_data.push(item);
// }
// non_header_row_data
// }