Is there a way to hide a particular item on some event in a ListView?
So far I can do it by setting visible
to false
and height
to zero of a delegate.
But If i have spacing in a listView set to 2 for example it appears that this solution is broken.
I think the proper way is to use a proxy model that filters out the elements that should not be displayed. You can use a QSortFilterProxyModel or implement your own QAbstractProxyModel. With that it is even possible to animate the removal and addition of the elements.
Or use SortFilterProxyModel if you don't wanna touch C++ and performance is not a problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With