Skip to content

(Qt example) using count as model has implications when you need scrolling #179

@tusooa

Description

@tusooa

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions