Closed laurent22 closed 10 years ago
Yes, that behavior is sane and should be expected. The model may cache the length internally and be smart about the fact the length hasn't in fact changed, so there's nothing to do as far as that information is concerned.
The proper way to handle this is to return a value for which you can call Changed on the data that really changed. This will also prevent spurious redrawing for content that wasn't modified.
Here is a hacked version of the delegate example that shows this working: 71378c3d
I'm trying to make a simple file manager with the qml package. I have this view at the moment, which displays a list of files:
From Go, when the model changes, I call
qml.Changed(files, &files.Len)
. This works well if the number of files before and after is different, however it does not do anything iffiles.Len
hasn't actually changed.Is this expected behavior? If so, is there any other way to force the view to refresh based on the model?