Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Number of items in a section in ListView



  • I am using a ListView with sections and like to know how many items are grouped in each section so I can show that number in the section delegate.

    I can write code in my QAbstractListModel which will find it out, but that would cause additional iterations over the underlying data. Thus I wonder if there is an easier and more efficient way to do this. What would be best practice?

    Ideally, the section delegate would have an attached property sectionCount or something similar, but I don't see that happen...


Log in to reply