PDA

View Full Version : How to sort QTableWidget column which has only image, no text



rawfool
25th June 2013, 14:49
I have a column in my QTableWidget with no text but has one of three things set to it's QTableWidgetItem. It might be either tick image(tick.png) or play image(play.png) or nothing. I need to sort based on these play image item rows first, then tick ones.
After the table rows are added with data, I tried

setSortingEnabled(true);
sortItems(4);
//sortByColumn(4); // this also didn't work

I'm getting a mark on that column that shows the rows can be sorted based on this column, but when I click on it, it's not aligning as expected. How do I solve this.
Thank you.