PDA

View Full Version : how to set a sort indicator for a particular section



nageshvk
17th November 2010, 11:48
hi

I have create a custom menu actions for sorting on QTableview.
When user selectes a header section and selects "asc" action i called below piece of code and it is working fine.

tableView->horizontalHeader()->setSortIndicator(sortedColumn,Qt::AscendingOrder);
tableView->horizontalHeader()->setSortIndicatorShown(true);

Now my issue was...
I clicked on the header view ..immediately sort indicator is showing on the selected column.

when i use tableView->horizontalHeader()->setSortIndicatorShown(false); i am losing the sort indicator of the sorted column.

so How to set a sort indicator for a particular section.

Regards
Nagesh