I use QListView to show some data. To add rows I use addItem() and when use activated() event a row number is for the order in which items were added. If sorting is enabled then row order changes and I can't get the initial row index of a particular row upon selection.

How can I get the initial row index existing before sorting after the sorting is performed?