Results 1 to 3 of 3

Thread: Abort/Cancel filter/sort in QSortFilterProxyModel or derivative

  1. #1
    Join Date
    Aug 2010
    Posts
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Abort/Cancel filter/sort in QSortFilterProxyModel or derivative

    Hi folks,

    perhaps anybody could give me a hint on how to cancel an active filtering or sorting in a QSortFilterProxyModel or in a derived class?!

    Imagine the following: You have a very large model and the user wants to filter that model on some regexp. The seconds went by while the model is filtered and now the user wants to stop the active filtering, perhaps via a progressdialogs's cancel button, or by pressing the escape key.

    How can we achieve the abortion of an active filtering? It seems to me that there are no special functions to tell the proxy to stop filtering or sorting...

    Thanks in advance
    olzzen

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Abort/Cancel filter/sort in QSortFilterProxyModel or derivative

    You cannot do that. Filtering with a sort filter proxy model is a synchronous operation. If you want an asynchronous operation, you have to implement filtering/sorting yourself by subclassing and reimplementing virtual methods.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2010
    Posts
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Abort/Cancel filter/sort in QSortFilterProxyModel or derivative

    Ok, i see.

    What do you mean, is it a simple and stupid solution to "processEvents" from within the "filterAcceptsRow"-Method and to test for an escape key-event. Then, if this event has occured, all further calls to "filterAcceptsRow" will return true...

    BTW: Is the abortion of an active filtering not a valid and often use-case which Qt should have been considered when implementing the sort/filter proxy-model?

Similar Threads

  1. Replies: 0
    Last Post: 4th August 2013, 03:41
  2. QSortFilterProxyModel : sort columns
    By Kouillo in forum Qt Programming
    Replies: 5
    Last Post: 12th September 2012, 08:44
  3. Custom Multi-Filter QSortFilterProxyModel
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2012, 13:26
  4. Filter a Filtered QSortFilterProxyModel !?
    By solook in forum Qt Programming
    Replies: 4
    Last Post: 25th October 2011, 19:22
  5. QSortFilterProxyModel - always sort 0 to the bottom
    By ironstorm in forum Qt Programming
    Replies: 2
    Last Post: 1st March 2008, 20:38

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.