Results 1 to 5 of 5

Thread: ASSERT(visualRow!=-1 ) Fails !

  1. #1
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Question ASSERT(visualRow!=-1 ) Fails !

    this ASSERT(visualRow!=-1 ) in file qtableview.cpp at line 992 fails . What does this mean : visualRow equals -1?
    i am using qt 4.6.0 on windows

    Thanks !
    Last edited by fmariusd; 4th February 2010 at 13:18.

  2. #2
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Question Re: ASSERT(visualRow!=-1 ) Fails !

    ............................. so ?

  3. #3
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 69 Times in 67 Posts

    Default Re: ASSERT(visualRow!=-1 ) Fails !

    It means that visualRow equals -1, which should never be the case. To say it more bluntly, it probably means you're doing something wrong in the code that uses the QTableView.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  4. #4
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: ASSERT(visualRow!=-1 ) Fails !

    I was deleting rows with the mouse in a tableview and when i deleted the last row the above problem occured.(each row had an X button for delete)
    Solution : select the last existing row in the tableview.

  5. #5
    Join Date
    Jul 2015
    Posts
    9
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows
    Thanks
    4

    Default Re: ASSERT(visualRow!=-1 ) Fails !

    This an old post but may be for colleagues who may face the the same challenge. I have found very few ideas on this....I faced the same scenario that led me to this Thread. My tableview was attached to a proxy model and a delegate. The table content was controlled by a mapper index where by each time the mapper changes...the content had to change. THUS I had to empty the tableview with view->setModel(NULL) (otherwise a static persistentEditor was being created especially the first index(i.e index(0,0)) once current Mapper Index was changed) The Crash only happens when the current tableview index is left blank ...but then for my case it was crashing only when other indexes having some data before the Mapper Index...changed

    Well, I solved it by emptying the tableview before submitAll() or revertAll() QSqlRelationalTableModel functions! Also before you close the window make sure to setFocus() on another widget (other than the tableview) on the window. All these are workarounds but If someone has a better solution please explain. I hope this helps someone!

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.