C++: move globals in a different struct

So that subcomponent don't depend on the root component name
which will hallow to have several root components
This commit is contained in:
Olivier Goffart 2024-06-14 15:12:55 +02:00
parent b7478bb88c
commit d0cdebfee6
2 changed files with 136 additions and 95 deletions

View file

@ -99,11 +99,10 @@ public:
cbindgen_private::slint_windowrc_set_focus_item(&inner, &item_rc, set_focus);
}
template<typename Component>
void set_component(const Component &c) const
void set_component(const cbindgen_private::ItemTreeWeak &weak) const
{
auto self_rc = (*c.self_weak.lock()).into_dyn();
slint_windowrc_set_component(&inner, &self_rc);
auto item_tree_rc = (*weak.lock()).into_dyn();
slint_windowrc_set_component(&inner, &item_tree_rc);
}
template<typename Component, typename Parent>