[Qt-interest] TableView and QSortFilterProxyModel
Zine eddine Bendjaballah
zineeddine.b at gmail.com
Sun Mar 8 18:37:40 CET 2009
Hi,
In my program I'm using a QTableView to display items from a model.
To edit an item I click on the tableview and after clicking on a button the
following code is running:
QModelIndex modelIndex;
modelIndex = tableview->currentIndex();
till now I always get the correct index of the item clicked in the
tableview.
Now, when I added a QSortFilterProxyModel object to allow the tableview to
be sorted the issue occurred.
After clicking on the column header, the items are sorted, and when I click
on the item I want to edit tableview->currentIndex() retruns the index of
the original item before the sorting was executed.
How to correct this?
Cheers.
--
Zine Eddine Bendjaballah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090308/7bcd0834/attachment.html
More information about the Qt-interest-old
mailing list