开发者

QTableWidget original index sorting

I am using QTableWidget and when the user clicks on a particular row, I use that index to perform some operation. I have also enabled sorting using setSortEnable, so when I sort it by clicking on a header, all row index change but I want previous index开发者_C百科 so what should I do?


I'm guessing you want the unsorted index so you can map that back to some external list of data? If that is the case, then you should use a QTableView() which will allow you to setup a sort proxy and map indexes back to your original data (model).

This question has some info that may help: Can't use itemFromIndex in clicked signal of QTreeView with QSortFilterProxyModel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜