Results 1 to 2 of 2

Thread: Column Sorting

  1. #1
    Join Date
    Jan 2006
    Location
    India
    Posts
    54
    Thanks
    1
    Thanked 7 Times in 6 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Column Sorting

    Hi

    In a QTable I am implementing the sorting, in which when user clicks one of the column the table sorted. Now the indexes of the rows have been changed.
    Before sorting
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9
    After sorting
    5, 9, 4, 2, 8, 6, 1, 3, 7, 0

    Now when I try to get whose index is 9, it will not give me the right value instead of it return the value of 0th index which actually at position 10th(actual 9 index).

    What should I do to get the right values.

  2. #2
    Join Date
    Jan 2006
    Location
    India
    Posts
    54
    Thanks
    1
    Thanked 7 Times in 6 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Column Sorting

    Hi

    actually in my table I am using widgets in one of the column and in other columns I am using my sub-classed QTableItem, but when I click on one of the column say name then only that column is sorted but neither the widget column nor other column sort.

    I read in Qt Docs when you widgets in a QTable and want to sort then you have to implement swapRows() or swapCells() explicitly, but I am not sure how should I reimplement them.

    thanks.

Similar Threads

  1. QTable column stretchable with minimum Width
    By sunil.thaha in forum Qt Programming
    Replies: 0
    Last Post: 24th April 2006, 13:17
  2. [QT4] QTreeView, QAbstractItemModel and sorting
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th March 2006, 20:16
  3. Sorting QTableView
    By Jimmy2775 in forum Qt Programming
    Replies: 7
    Last Post: 9th February 2006, 16:47
  4. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 15:51

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.