mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Do the initialization in the same order in C++ and rust
First the parent component, then the properties.
This commit is contained in:
parent
43ae3aa124
commit
1fac9b7ad0
1 changed files with 1 additions and 3 deletions
|
@ -1262,7 +1262,6 @@ fn generate_sub_component(
|
|||
let mut subtrees_ranges_cases = Vec::new();
|
||||
let mut subtrees_components_cases = Vec::new();
|
||||
|
||||
let mut subcomponent_init_code = Vec::new();
|
||||
for sub in &component.sub_components {
|
||||
let field_name = ident(&sub.name);
|
||||
let local_tree_index: u32 = sub.index_in_tree as _;
|
||||
|
@ -1281,7 +1280,7 @@ fn generate_sub_component(
|
|||
format!("tree_index_of_first_child + {} - 1", local_index_of_first_child)
|
||||
};
|
||||
|
||||
subcomponent_init_code.push(format!(
|
||||
init.push(format!(
|
||||
"this->{}.init(root, self_weak.into_dyn(), {}, {});",
|
||||
field_name, global_index, global_children
|
||||
));
|
||||
|
@ -1452,7 +1451,6 @@ fn generate_sub_component(
|
|||
));
|
||||
}
|
||||
|
||||
init.extend(subcomponent_init_code);
|
||||
init.extend(properties_init_code);
|
||||
init.extend(component.init_code.iter().map(|e| compile_expression(&e.borrow(), &ctx)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue