Results 1 to 12 of 12

Thread: QTableView sorting problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableView sorting problem

    Finally the problem was solved using the QSortFilterProxyModel class that wysota recommends.

    Thanks for your concern janus

    The code that I was using to try was:
    Qt Code:
    1. myDialog dialog;
    2. dialog.exec();
    3.  
    4. formUser frm1;
    5. frm1.show();
    To copy to clipboard, switch view to plain text mode 

    And the formUser only has the table.

  2. #2
    Join Date
    Mar 2008
    Posts
    141
    Thanks
    10
    Thanked 9 Times in 9 Posts

    Default Re: QTableView sorting problem

    @noktus
    Dont mind. it is also concern for my code

    @wysota
    QSortFilterProxyModel helped me as well. Now sorting even works with a queryModel ( I can not use QSqlTableModel because it locks the sqlite database). AND sorting with the QSqlTableModel did change the rowhight (table->resizeRowsToContents() did not work). So thx. This solves two problems I had.

Similar Threads

  1. QTableView sorting
    By gabriels in forum Qt Programming
    Replies: 11
    Last Post: 6th October 2010, 17:13
  2. Problem with QTableView
    By BoneCollector in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2008, 12:30
  3. Slow problem QTableView
    By skuda in forum Qt Programming
    Replies: 6
    Last Post: 26th February 2008, 12:19
  4. problem in printing QTableView
    By miguel_mark in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 08:19
  5. Sorting QTableView
    By Jimmy2775 in forum Qt Programming
    Replies: 7
    Last Post: 9th February 2006, 16:47

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
  •  
Qt is a trademark of The Qt Company.