Results 1 to 1 of 1

Thread: How to sort QTableWidget column which has only image, no text

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How to sort QTableWidget column which has only image, no text

    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
    Qt Code:
    1. setSortingEnabled(true);
    2. sortItems(4);
    3. //sortByColumn(4); // this also didn't work
    To copy to clipboard, switch view to plain text mode 

    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.
    Last edited by rawfool; 25th June 2013 at 15:58.

Similar Threads

  1. sort row by column , when getting text alwas wrong
    By umen in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2011, 09:35
  2. Replies: 0
    Last Post: 15th June 2010, 15:22
  3. How does the QTableWidget sort a column?
    By codemonkey in forum Qt Programming
    Replies: 1
    Last Post: 4th October 2009, 14:21
  4. QTreeView: get current sort column and order
    By supergillis in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2008, 18:25
  5. Replies: 2
    Last Post: 20th August 2008, 16:55

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.