mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
c++: Generate better indices for the parent node of repeaters
This commit is contained in:
parent
8a036ef293
commit
1888ecfd65
2 changed files with 2 additions and 2 deletions
|
@ -942,7 +942,7 @@ fn generate_item_tree(
|
|||
format!(
|
||||
// that does not work when the parent is not a component with a ComponentVTable
|
||||
//" *result = slint::private_api::parent_item(self->parent->self_weak.into_dyn(), self->parent->get_item_tree(), {});",
|
||||
"*result = {{ self->parent->self_weak, {} }};",
|
||||
"*result = {{ self->parent->self_weak, self->parent->tree_index_of_first_child + {} - 1 }};",
|
||||
parent_index,
|
||||
)
|
||||
} else {
|
||||
|
|
|
@ -1027,7 +1027,7 @@ fn generate_item_tree(
|
|||
.parent
|
||||
.clone()
|
||||
.upgrade()
|
||||
.map(|sc| (VRcMapped::origin(&sc), sc.as_pin_ref().tree_index_of_first_child.get()))
|
||||
.map(|sc| (VRcMapped::origin(&sc), sc.tree_index_of_first_child.get()))
|
||||
{
|
||||
*result = slint::re_exports::ItemRc::new(parent_component, parent_index as usize + #sub_component_offset - 1)
|
||||
.downgrade();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue