How to let the first ListElement don't display
-
i want to use ListView to display ListElements which provided by ListModel,but i don't want to display the first ListElement,who can help me how to do it?thank you!
-
I don't think it's possible with standard methods (you could remove the first row from the model, but I take it that's not what you want). May I ask what the use case is?
-
because in my code i can't display the first ListElement
-
Yes, I got that, my question is, if you can't display it, why have it as a list element anyway and not e.g. as a property in the model.
-
You can use a proxy model (e.g. based on [[Doc:QSortFilterProxyModel]]). Maybe you must fiddle around a bit in some C++ helper classes though.
-
the model is created by C++,but i needn't display the first ListElement,who can tell me how to implement this but not change the model which created by C++
-
Use a QSortFilterProxyModel, and reimplement it to return false for the row number 0 in the filterAcceptsRow() method.