Results 1 to 6 of 6

Thread: How can I properly implement QSortFilterProxyModel.parent to handle a virtual column?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How can I properly implement QSortFilterProxyModel.parent to handle a virtual col

    @Unai: For some reason, the forum put both of your posts into the "Moderation queue" for approval before they could become visible to the rest of the users. No idea why. I deleted the duplicate post and approved this one. Sorry about that.

    I have created proxies with virtual columns, but in C++. I'll have to read through your code later and see if anything jumps out. There is a logical issue of what to do with "map to source" when the source index doesn't exist, and I think I have simply returned an invalid index. If you are relying on a pointer to something being stored in the QModelIndex, and that pointer is null, then that could certainly cause a segfault.

    *Edit: You define (and access) a "self._parents" list (dictionary? I'm not a python expert), but I don't see anywhere that you are putting anything into this list. So calling self._parents[index] is probably the source of the crash.
    Last edited by d_stranz; 1st September 2021 at 16:42.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 1
    Last Post: 14th June 2011, 15:50
  2. QSortFilterProxyModel not filtering properly
    By freemind in forum Qt Programming
    Replies: 9
    Last Post: 8th August 2010, 01:23
  3. Any way to properly handle Windows DPI setting?
    By vaddimka in forum Qt Programming
    Replies: 15
    Last Post: 16th May 2010, 10:03
  4. Unable to properly implement a QRubberBand
    By jamadagni in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2009, 12:39

Tags for this Thread

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.