Results 1 to 4 of 4

Thread: QSortFilterProxyModel & QTreeView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSortFilterProxyModel & QTreeView

    Hi, I've encountered the same error twice. I solved it the first time but not the second .

    For the first error, I used in some loops invalid indexes as ending conditions, but proxy model does not seems to appreciate access to invalid indexes (out of range) whereas in my custom model, out-of-range index requests return invalid indexes. So I rewrite my loops to avoid out-of-range index request.

    For the second error, I've not found any solution yet. It seems that proxy model maintains persistent indexes. Thoses indexes are modified by the QTreeView when expanding. But when the QSortFilterProxyModel tries to access thoses indexes, they seems to be invalid. I don't understand why thoses indexes are invalid, since they are set by the QTreeView.

    Edit:
    I've found a workaround for my case. I disconnect the signal between modelReset() and reset() in my derived class constructor of QSortFilterProxyModel and it seems to work. But I only have to fully expand/collapse the tree, maybe there's more to do in your case.
    Last edited by inz; 31st January 2006 at 14:55.

Similar Threads

  1. QTreeView repaint
    By graeme in forum Qt Programming
    Replies: 17
    Last Post: 13th March 2012, 13:27
  2. Direct root childs inline QTreeView
    By faraslacks in forum Qt Programming
    Replies: 2
    Last Post: 15th January 2009, 07:45
  3. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 21:22
  4. background image in QTreeView
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 06:25
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.