Results 1 to 9 of 9

Thread: ASSERT Failure in QAbstractItemModel Pure Virtual Function

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2016
    Location
    Ridgecrest California
    Posts
    33
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: ASSERT Failure in QAbstractItemModel Pure Virtual Function

    Quote Originally Posted by ChristianEhrlicher View Post
    Qt Code:
    1. 121 if(index.isValid())
    2. 122 pItem = static_cast<ModelItem*>(index.internalPointer());
    3. 123 else
    4. 124 pItem = pRoot;
    5. 125 return pItem->getData(index.column());
    To copy to clipboard, switch view to plain text mode 
    What would you expect here instead of an assertion when index is not valid? Hint: when index is not valid, index.column() will not contain a valid column but -1...
    Thanks! That pointed out the error of my ways. It seems so obvious now.
    Thanks again.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: ASSERT Failure in QAbstractItemModel Pure Virtual Function

    Yes, I did a dope slap on my head as well. Sorry for sending you on a wild goose chase when the problem was staring us in the face. Sometimes no matter how carefully you read code, the obvious escapes you.
    <=== 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: 11
    Last Post: 14th August 2014, 09:08
  2. Assert failure with tablet installed
    By Spectralist in forum Qt Programming
    Replies: 2
    Last Post: 21st April 2011, 13:31
  3. Problem debugging Assert failure.
    By Doug Broadwell in forum Qt Programming
    Replies: 3
    Last Post: 3rd January 2009, 18:39
  4. Debugging ASSERT failure in Qt header.
    By Doug Broadwell in forum Qt Programming
    Replies: 6
    Last Post: 27th December 2008, 01:40
  5. QWT assert failure
    By Andimat in forum Qwt
    Replies: 1
    Last Post: 21st June 2007, 14:36

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.