Results 1 to 3 of 3

Thread: [SOLVED] QSortFilterProxyModel crash

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default [SOLVED] QSortFilterProxyModel crash

    Hi !

    I have a QLineEdit and a QListView. I use a QSortFilterProxyModel to filter my list. It works great. Then, I want to know which line is selected in my QLIstView. I use selectedindexex and QSortFilterProxyModel::data. But if I have not typed anything in the qlineedit it will give me a segfault. If I type something it works great. If I erase what I have typed it also works. In fact it only fails if nothing has never been typed in the LineEdit.

    Any Idea ?

    Thanks
    Last edited by Guilo; 22nd April 2010 at 20:19. Reason: solved

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

    Default Re: QSortFilterProxyModel crash (bug ?)

    Can we see the code that causes the crash?
    Last edited by wysota; 22nd April 2010 at 20:41.
    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
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QSortFilterProxyModel crash (bug ?)

    I have found my error when looknig for the code i should paste here. The pointer on the QSortFilterProxyModel was initialized in the slot where I do the filter. So When I had never typed anything it crashed...

Similar Threads

  1. Replies: 3
    Last Post: 6th February 2010, 20:07
  2. QSortfilterProxyModel and Treeview
    By hunsrus in forum Qt Programming
    Replies: 0
    Last Post: 27th March 2009, 12:36
  3. QSortFilterProxyModel - crash
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2008, 14:14
  4. Using QSortFilterProxyModel
    By Jennie Bystrom in forum Qt Programming
    Replies: 3
    Last Post: 6th December 2007, 10:28
  5. QSortFilterProxyModel
    By evgenM in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2007, 11:53

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.