By using QSortFilterProxyModel, then when sorting, the sequence of the vertical header in QTableView also changed. How do I not change order number in the vertical header when column sorted ?
Sorry, my english is bad
By using QSortFilterProxyModel, then when sorting, the sequence of the vertical header in QTableView also changed. How do I not change order number in the vertical header when column sorted ?
Sorry, my english is bad
Reimplement headerData() on the proxy and always return the regular sequence of row numbers.
OK, I so confused. Can you give me example code ?
Qt Code:
if(orientation!=Qt::Vertical || role!=Qt::DisplayRole) return section; }To copy to clipboard, switch view to plain text mode
That's can start from 0
So, i chane like this
Qt Code:
if(orientation!=Qt::Vertical || role!=Qt::DisplayRole) return section+1; }To copy to clipboard, switch view to plain text mode
Thank's for your sample code. Solved now.
Bookmarks