appending to a list now also triggers _notify_change_start

This helps in understanding if the list entries being added are "changing" themselves. Properties within
the added objects will trigger property changes when they are serialized, so we have to tell the observer
that he should not listen to them.
This commit is contained in:
Mose Müller 2024-02-20 12:28:34 +01:00
parent bd7a46ddc1
commit c0ba23b0b2

View File

@ -148,6 +148,7 @@ class _ObservableList(ObservableObject, list[Any]):
self._notify_changed(f"[{key}]", value) self._notify_changed(f"[{key}]", value)
def append(self, __object: Any) -> None: def append(self, __object: Any) -> None:
self._notify_change_start("")
self._initialise_new_objects(f"[{len(self)}]", __object) self._initialise_new_objects(f"[{len(self)}]", __object)
super().append(__object) super().append(__object)
self._notify_changed("", self) self._notify_changed("", self)