Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Number of items in a section in ListView
Qt 6.11 is out! See what's new in the release blog

Number of items in a section in ListView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 315 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moerkb
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved