C++ Make sure that the layout is properly updated when the model of a for or if changes

The problem is that the backend is using the `meta_property_listener` to know
if the layout must be updated, but the C++ code would not register a dependency

NOTE about the test: The test doesn't really test that it works because
the test backend don't have a meta_property_listener and apply the layout
inconditionally in sixtyfps_send_mouse_click
This commit is contained in:
Olivier Goffart 2021-02-18 09:40:12 +01:00
parent 13a2138022
commit b34a34cea0
2 changed files with 59 additions and 9 deletions

View file

@ -552,6 +552,10 @@ public:
} else {
inner->data.clear();
}
} else {
// just do a get() on the model to register dependencies so that, for example, the
// layout property tracker becomes dirty.
model.get();
}
}