Results 1 to 4 of 4

Thread: benefits SortFilterProxyModel vs own sort in custom table model?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: benefits SortFilterProxyModel vs own sort in custom table model?

    Quote Originally Posted by DoTheEvo View Post
    But i also came over SortFilterProxyModel that I could implement. Is that the better way?
    That is a generic way, not necessarily better in ever aspect.

    It is "better" in the sense that you don't need to implement anything, i.e. avoiding a source of error/mistake.

    Your approach of providing a sorted view on the data is better as it can take the data, its inherent semantic and update behavior into account.

    Quote Originally Posted by DoTheEvo View Post
    The speed is my most important aspect, as my program is just a search in a database showing results in tableview as you type queries, and it needs to be instant.
    I would go with directly presenting the data in the way it should be displayed, i.e. have the model provide the data in the way it should be sorted.
    Either by sorting in the model or letting the database already retrieve the values that way.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    DoTheEvo (3rd August 2017)

Similar Threads

  1. Replies: 2
    Last Post: 1st May 2013, 06:49
  2. Replies: 0
    Last Post: 17th March 2010, 12:17
  3. SortFilterProxyModel data
    By gyre in forum Newbie
    Replies: 5
    Last Post: 6th December 2007, 22:09

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.