C++: Setting a value to a property having a binding should always clear the binding

... even if the old value holds the same value as the new value

This fixes test_cpp_bindings_two_way_priority_default

Also add a C++ unit test that tests the Property type specificaly
This commit is contained in:
Olivier Goffart 2022-05-07 17:17:34 +02:00 committed by Olivier Goffart
parent a2d5ddaeca
commit 2aaefa8e0d
3 changed files with 45 additions and 1 deletions

View file

@ -75,7 +75,7 @@ struct Property
void set(const T &value) const
{
if (this->value != value) {
if ((inner._0 & 0b10) == 0b10 || this->value != value) {
this->value = value;
cbindgen_private::slint_property_set_changed(&inner, &this->value);
}