Results 1 to 5 of 5

Thread: QSortProxyModel isnt notified when the sourceModel dies

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Posts
    248
    Thanks
    29
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QSortProxyModel isnt notified when the sourceModel dies

    Hey,

    I have a QSortProxyModel that leeches off another model that I set with setSourceModel().

    When the sourceModel is destroyed, but the QSortProxyModel is still attached to the GUI, it ends up showing ugly empty rows (see screenshot). At this point, sourceModel() method returns NULL and my overriden rowCount() in the QSortProxyModel also returns 0.

    But it looks like this isnt enough, I guess this should trigger a reset_model signal, which it seems isnt done automatically when the sourceModel dies.

    Am I expected to monitor the lifetime of the sourceMOdel on my own? Seems unnecessary, and I already take care of rowCount().
    Attached Images Attached Images

Similar Threads

  1. Replies: 0
    Last Post: 17th March 2010, 12:17
  2. Replies: 5
    Last Post: 14th May 2009, 09:06
  3. My QThread dies
    By Althor in forum Qt Programming
    Replies: 1
    Last Post: 10th November 2008, 14:08
  4. QList<char*> dies
    By thomaspu in forum Qt Programming
    Replies: 11
    Last Post: 15th March 2008, 22:47
  5. Detect when a TCP Server dies
    By jimroos in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2007, 23:40

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