First thanks to the community that always provide great help.
I have a big problem using my QTableView while sorting.
My table view is used to display a list of contacts, so they are individual items. I need to display those contacts in list mode and tile mode.
I have all my contacts in a QObjectList, then I create a QAbstractTableModel that use this list as the model data and a QAbstractItemDelegate that paint the data.
I need to sort the table view as well so I have created a QSortFilterProxyModel and set it to the table view.
Then I call proxy->sort(0, ascending/descending) and my table is updated.
Everything works fine in list mode, my model returns rowCount = the number of contacts and columnCount= 1.
But there is a big problem while I want to display my items in tile mode, my model returns rowCount = ceil((float)number of contacts / 3); and columnCount= 3 then on the first columns contacts are well sorted but on other columns this is a mess, nothing is sorted correctly and I even have blank tile (or cell) in the middle of the table view.
The same problem occurs while filtering the contact with the proxy.
So My question is how can do that ? I even think that I can't do it with a table view because it needs to have the same data for a single row and display the data informations in the different columns.
If I can't use a QTableView do I have to create a special widget with scrolling and put all my contacts in it ? Doing this make me sick because I have to implement clicks, sorts and filters by hand.
Thanks for you reply anyway.