mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Cpp: Add a self_weak to repeated components
The main struct has it, and sub-components should have it, too.
This commit is contained in:
parent
ba96e8570f
commit
a2839e03c2
2 changed files with 13 additions and 0 deletions
|
@ -566,6 +566,8 @@ public:
|
|||
auto &c = inner->data[i];
|
||||
if (!c.ptr) {
|
||||
c.ptr = { vtable::VRc<private_api::ComponentVTable, C>::make(parent) };
|
||||
const_cast<C *>(&**c.ptr)->self_weak =
|
||||
vtable::VWeak<private_api::ComponentVTable, C>(*c.ptr);
|
||||
}
|
||||
if (c.state == RepeaterInner::State::Dirty) {
|
||||
(*c.ptr)->update_data(i, m->row_data(i));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue