You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using count as the model in ListView, the problem is that model value will be changed whenever we add or remove an item, and the scroll will be reset. Using a QAbstractListModel is a better solution, because the model is a QObject, and its value (reference/pointer) won't change when we change it, thus eliminating the need to do special handling when the count changes.
The text was updated successfully, but these errors were encountered:
Yes, that's true. I use QAbstractListModel in my real world code. It is a bit trickier to do and that's why I use the other mechanism for simplicity. But it would be worth adding an example.
(See https://lily-is.land/kazv/kazv/-/merge_requests/26 )
When using count as the model in ListView, the problem is that model value will be changed whenever we add or remove an item, and the scroll will be reset. Using a QAbstractListModel is a better solution, because the model is a QObject, and its value (reference/pointer) won't change when we change it, thus eliminating the need to do special handling when the count changes.
The text was updated successfully, but these errors were encountered: