Unsolved How to filter first row of the model
-
I have written model in Qt and i am using QML list view to display the model content. I want to filter zeroth row of the model that means i want to display the content from index 1 to index n. Let me know how can we do it
-
Two solution for that :
You could hide the first row in your delegate, with something likevisible: model.index !== 0
.
Or you could really filter it with a proxy model.I've written a library to accomplish this : https://github.com/oKcerG/SortFilterProxyModel/
You could use it this way :
import SortFilterProxyModel 0.2 // ... SortFilterProxyModel { id: proxyModel sourceModel: myModel filters: IndexFilter { minimumIndex: 1 } // show elements from index 1 and up } ListView { model: proxyModel // ... }