Replies: 1 comment 1 reply
-
Whether the old values get deleted or not depends on what you do: They do get replaced when you replace the entire model (even if most entries contain the same data). They are not replaced when you add a new element into the current model. You seem to be doing the latter, but that is hard to tell with just a few snippets of code. The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I created a small application to test rust with slint Multimeter Control and I have some architecture design questions.
I have a mainwindow which is able to show multiple multimeter controls at the same time. They can be added dynamically by clicking a button. Once I click the button I will pick up the model and add new multimeter data
(https://gitlab.com/Murmele/multimetercontrol/-/blob/main/src/lib.rs?ref_type=heads#L30-L32)
dmm_data
is an array in the AppWindow:in property <[DmmData]> dmm_data: [];
When the model changes, in slint new objects get created. That means that all previous Dmm objects get deleted and all are recreated?
https://gitlab.com/Murmele/multimetercontrol/-/blob/main/ui/dmm-control.slint?ref_type=heads#L32-L43
AppWindow:
Then I assign data to that
Dmm
object. So the ip is stored once in the modeldmm_data
and in theDmm
object and at least also in the ip-text object or am I wrong?Is there a better way to handle the data so that there exist less number of copies?
Beta Was this translation helpful? Give feedback.
All reactions