mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
C++: Make component_at() return a ComponentWeak
This commit is contained in:
parent
b9fddc4ae1
commit
e5aadd7c26
2 changed files with 3 additions and 3 deletions
|
@ -848,10 +848,10 @@ public:
|
|||
return { &C::static_vtable, const_cast<C *>(&(**x.ptr)) };
|
||||
}
|
||||
|
||||
void component_at(int i, vtable::VWeak<private_api::ComponentVTable> *result) const
|
||||
vtable::VWeak<private_api::ComponentVTable> component_at(int i) const
|
||||
{
|
||||
const auto &x = inner->data.at(i);
|
||||
*result = vtable::VWeak<private_api::ComponentVTable>{x.ptr->into_dyn()};
|
||||
return vtable::VWeak<private_api::ComponentVTable>{x.ptr->into_dyn()};
|
||||
}
|
||||
|
||||
private_api::IndexRange index_range() const {
|
||||
|
|
|
@ -1395,7 +1395,7 @@ fn generate_sub_component(
|
|||
subtrees_components_cases.push(format!(
|
||||
"\n case {i}: {{
|
||||
{e_u}
|
||||
self->{id}.component_at(subtree_index, result);
|
||||
*result = self->{id}.component_at(subtree_index);
|
||||
return;
|
||||
}}",
|
||||
i = idx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue