Important: Please read the Qt Code of Conduct -

Hiding some listelement in a section

  • Hi everyone,

    As we know, we can create a section in a listview to group listelements. Now, what i would like to do is to hide some listelements(because there are too many listelements in a section), and create a button at the end of a section. when i clicked the buttom. all of the rest listelements show up.

    I tried to use simple list view, but i failed.

    Does anyone have ideas?

  • Essentially you need to filter your Data. Implementation depends on your model. You may use a QSortFilterProxyModel to filter your data. Another option is to implement the filtering yourself.
    Do not forget to emit dataChanged() once you have reduced the items in your pool.

Log in to reply